All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
DeviceCapabilityModule to DeviceModule for brevity
modules/device-capability to modules/deviceDeviceCapabilityModule to DeviceModuleimport { DeviceModule } from '@grabjs/superapp-sdk'ScopeModule.hasAccessTo() now returns result as a plain boolean instead of an object { hasAccess: boolean }HasAccessToResult type and schema updated to v.boolean() (simplified API)isError() guard now validates error is a non-empty string instead of just checking property existenceguides/ai-assistance.md — setup guide for AI-assisted development with Cursor and Claudevalibot moved from devDependencies to dependencies (runtime requirement for schema validation)GetCoordinateResult properties renamed from lat/lng to latitude/longitude for consistencysrc/index.ts to use barrel exports (cleaner imports from module index files)build-skills.mjs excludes ai-assistance.md from skill generation (setup guide, not conceptual)Logger utility class for scoped logging ([SuperAppSDK][ModuleName.method]) across all SDK modulesVerifyEmailResult schema and type export for email verification responsesProfileModule.verifyEmail() now accepts optional request parameters and returns the verified email in resultVerifyEmailRequest type updated to use skipUserInput instead of otp for native bottom sheet flowTriggerCheckoutResult documentation improved with clearer status-to-field mappingconsole.warn to the new Logger utility for validation warningsBridgeErrorStatusCodebridgeSuccessSchema function (superseded by bridgeOkSchema)CheckoutModule — added important disclaimers to method and type documentation; added note that mobile scope is requiredLocaleModule — added list of supported locales to SupportedLocale type documentationLocationModule — getCountryCode now correctly returns result as a plain string (e.g. 'SG') instead of an object { countryCode: string }; updated GetCountryCodeResult type, schema, and documentation accordinglyStorageModule — added note that stored data is cleared when the user logs outguides/concepts.md — new Core Concepts guide covering the response pattern, status codes, type guards, and streamsguides/setup.md — moved environment requirements to Core Concepts guideskills/SKILL.md — guides now ordered explicitly (Setup → Core Concepts → Integration Guide); Classes and Functions wrapped under ## API Referencescripts/skills-template.md — reduced to frontmatter and intro; all content lives in guidesskills/SKILL.md file with inlined guides and API referencesbuild-skills.mjs now generates unified skill file instead of separate directoriesskills/guides/ directory (guides now inlined into SKILL.md)skills/references/ directory (classes and functions now inlined into SKILL.md)skills/SKILL.md metadata and documentationbuild-skills.mjs script to generate skill references from TypeDoc APIskills/references/ with generated class and function documentation for AI contextskills/guides/ with setup and integration guides for AI-assisted developmentskills directory included in npm package filesvalibot for all module requests and responsesschemas.ts) for all modules with valibot validation schemasvalidate() protected method to BaseModule for pre-invocation validationrequestSchema and responseSchema options to InvokeOptions interfaceformatIssues() utility for human-readable validation error formattingtypedoc-plugin-valibot dev dependency for schema documentationisOk(), isNoContent(), isFound() type guards for granular status code narrowingvalibot added as peer dependency (replaces @grabjs/mobile-kit-bridge-sdk peer dependency)@grabjs/mobile-kit-bridge-sdk moved from peerDependencies to devDependenciesinvoke() and invokeStream() methods now perform automatic request/response validation when schemas are providedisErrorResponse() type guard renamed to isError() for consistencyBridgeStatusCode, BridgeError, BridgeSuccessResponse, etc.)ResponseStatusCode200, ResponseStatusCode204, etc.)SplashScreenModule, the native splash / Lottie loading screenisSuccess() and isErrorResponse() type guards instead of switch-case patternsBaseModule.invoke() changed from public to protected visibilityBaseModule.invoke() and BaseModule.invokeStream() to include actual error detailsBaseModule constructor error messagetypedoc/ directoryisErrorWithMessage() utility from main entry pointInvokeOptions type from main entry pointapi-reference/markdown/ directorytypedoc-plugin-markdown dev dependency for Markdown documentation outputtypedoc.md.json configuration for Markdown doc generationapi-reference directory included in npm package filesapi-reference/json/api.json/docstypedoc-plugin-no-inherit dev dependency for cleaner API documentation@noInheritDoc and @hidden TSDoc tags support in tsdoc.json/docs@noInheritDoc to exclude inherited BaseModule documentationBaseModule class marked with @hidden to exclude from public API docsDeviceCapabilityModule with isEsimSupported() support, exported response/result types, unit tests, and manual documentationUserAttributesModule with getSelectedTravelDestination() support, exported response/result types, unit tests, and manual documentationInvokeOptions interface for flexible method invocation configurationguards.ts for runtime BridgeResponse type narrowingsrc/core/types.ts fileFileModule for downloading files via the native bridge (downloadFile method)DownloadFileRequest and DownloadFileResponse types for file operationsFileModuleBaseModule.invoke() now returns errors via status_code instead of throwing@throws annotations from all module methodsAuthorizationConfigurationError class for identity authorization failuresdetectGrabApp() utility for automatic Grab app detection from user agentisRunningInGrabApp() utility to check if code runs inside Grab app webviewplatform, error, and version utilitiesgetErrorMessage() and errorHasMessage() with isErrorWithMessage() type guardwindow.navigatorIdentityModule uses AuthorizationConfigurationError for configuration failuresuser-agent utility directory (replaced by platform utilities)getErrorMessage() and errorHasMessage() functions (use isErrorWithMessage() instead)GetAuthorizationArtifactsResult type no longer nullable, always returns object structureCameraModule.scanQRCode() methodtest, test:check, and test:watch for running testsbuild:watch npm script for development workflow**/*.test.ts) with relaxed type safety for mocks.prettierignore and ESLint ignore patterns to exclude coverage/ directorycheck npm script to include test:checkisSuccess, isRedirection, isClientError, isServerError, isErrorResponse) for runtime BridgeResponse type checkingBaseModule.invoke() now returns Promise<BridgeResponse<T>> | DataStream<T> with proper error handlingBridgeRedirectResponse to BridgeRedirectionResponse for naming consistencyerror: null fieldsWrappedModule.invoke() signature simplified for better type inferenceBridgeStatusCode401Response and BridgeStatusCode501ResponsegetErrorMessage, errorHasMessage) in src/utils/error/BaseModule.invoke() method with automatic Grab app environment checkingthis.invoke() instead of this.wrappedModule.invoke() for automatic environment detectionswitch (response.status_code) pattern instead of type guardssrc/index.tsisResponseOk, isResponseError, isResponseSuccess, etc.) - use response.status_code checks insteadsrc/utils/crypto/) using native Web Crypto API for PKCE operationssrc/modules/identity/constants.tsresources/copyright.txt for shared license header contentIdentityModule refactored to use new crypto utilities and centralized constantsgeneratePKCEArtifacts() is now async to support native crypto.subtle digestresources/copyright.txt directly instead of JS import@grabjs/mobile-kit-bridge-sdk from dependencies to devDependenciescrypto-js dependency (replaced by native Web Crypto API)scripts/constants.mjs (superseded by resources/copyright.txt)IdentityModulecrypto-js with native Web Crypto API for improved security and reduced bundle sizetypescript-eslint for type-aware lintingSendAnalyticsEventRequest.data type changed from Record<string, any> to Record<string, unknown>BaseModule initialization errors now include the original error as cause*Result type imports from Camera, Checkout, Identity, Profile, Scope, Storage, and SystemWebViewKit modulesisResponseOk, isResponseError, isResponseSuccess, isResponseClientError, isResponseServerError, etc.) for runtime response type checkingPromise<Response> instead of Promise<any>IdentityModule (authorize, getAuthorizationArtifacts, clearAuthorizationArtifacts methods)ProfileModule (fetchEmail, verifyEmail methods)SystemWebViewKitModule (redirectToSystemWebView method)src/index.ts) and module barrel exportsScopeModule.hasAccessTo() now accepts separate (module, method) parameters instead of HasAccessToRequest objectContainerModule.isConnected() refactored to use isRunningInGrabApp() utilityIdentityModule.shouldUseWebConsent() and ProfileModule.isSupported() refactored to use new platform utilitiesStorageModule methods now accept individual parameters (key, value) instead of object parameters ({key, value}) to match the existing public APIHasAccessToRequest type (replaced by direct parameters)SetBooleanRequest, SetIntRequest, SetStringRequest, SetDoubleRequest types (methods now use direct parameters)IdentityModule.parseGrabUserAgent() and isVersionBelow() static methodsProfileModule.parseGrabUserAgent() and isVersionBelow() static methodsLocaleModuleScopeModule (hasAccessTo, reloadScopes methods)StorageModule (all storage operations: boolean, int, string, double, remove, removeAll)*Result types for all ContainerModule response types for better type consistencysrc/index.ts)LocaleModule.getLanguageLocaleIdentifier() now returns typed Promise<GetLanguageLocaleIdentifierResponse>ScopeModule.hasAccessTo() now accepts HasAccessToRequest parameter and returns Promise<HasAccessToResponse>ScopeModule.reloadScopes() now returns Promise<ReloadScopesResponse>StorageModule methods now use typed request/response parametersContainerModule response types now use dedicated *Result types instead of nulltriggerCheckout() methodTriggerCheckoutRequest, TriggerCheckoutResponse, and TriggerCheckoutResult typesWrappedModule.invoke() with conditional return types for streaming methodsContainerModule.isJSBridgeConnected() to include result: null in all branchestsdoc.json) to support custom @group tags@group Modules tags to all module classes for better TypeDoc organizationwrappedModule getter to BaseModule for consistent JSBridge module accessWrappedModule interface and exported it from main entry pointsrc/types/global.ts:src/index.ts entry pointsrc/index.ts entry pointthis.wrappedModule.invoke() instead of direct window.Wrapped*Module!.invoke accessIdentityModule.performNativeAuthorization() from static to instance methodsrc/modules/container/types.ts to replace inline WrappedContainerModule interface with granular type definitionsany typesindex.ts barrel exports by removing duplicate type re-exports (now centralized in main index.ts)BridgeResponse<T> patterns across all container methodssrc/modules/container/types.ts to replace inline WrappedContainerModule interface with granular type definitionsany typesindex.ts barrel exports by removing duplicate type re-exports (now centralized in main index.ts)BridgeResponse<T> patterns across all container methodstypedoc and typedoc-plugin-markdown dev dependenciestypedoc.json configuration for documentation generationbuild:docs npm script to generate API documentationtypedoc/ directory covering all modules and typesbuild script to include both JS build and documentation generationbuild:js instead of build to avoid generating docs in CI pipeline@typeparam to @typeParam in src/core/stream/types.tsScanQRCodeRequest - Configuration options for QR code scanningScanQRCodeResponse - Typed response from QR code scan operationScanQRCodeResult - Result object containing the scanned QR code dataCameraModule.scanQRCode()format:check → check:formatformat:fix → fix:formatlint:check → check:lintlint:fix → fix:lintcheck and fix scripts to use renamed sub-scriptscheckout/types.ts@rollup/plugin-alias dependency (no longer needed)BaseModule abstract class in src/core/module/ for unified module initializationsrc/core/response/types.ts)src/core/stream/types.ts)src/modules/CameraModule, CheckoutModule, ContainerModule, IdentityModuleLocaleModule, LocationModule, MediaModule, PlatformModuleProfileModule, ScopeModule, StorageModule, SystemWebViewKitModuleindex.ts) for all module directories for cleaner importsContainerAnalyticsEventState, ContainerAnalyticsEventName, ContainerAnalyticsEventData constantsBaseModule class for consistent initializationContainerModule.js → src/modules/container/ContainerModule.tsIdentityModule.js → src/modules/identity/IdentityModule.tsProfileModule.js → src/modules/profile/ProfileModule.tsStorageModule.js → src/modules/storage/StorageModule.tssrc/ to feature-based src/modules/{name}/ layoutsrc/index.ts exports to reflect new module pathssrc/ root:
CameraModule.js, CheckoutModule.js, LocaleModule.js, LocationModule.jsMediaModule.js, PlatformModule.js, ScopeModule.js, SystemWebViewKitModule.jstsconfig.json for TypeScript compilation configurationscripts/build.mjs for orchestrated build processexports fieldmodule field for ESM entry pointtypes field pointing to bundled type definitions.nvmrc specifying Node.js version 24clean npm script for removing build artifactstypescript, tslib, @rollup/plugin-typescript, @types/nodesrc/index.js → src/index.ts)build script to use new scripts/build.mjs orchestratorfiles field to only include dist directoryrollup.config.mjs).babelrc)rollup-plugin-babel, rollup-plugin-commonjs, rollup-plugin-node-resolve, rollup-plugin-uglifydocs directory from published package filesrollup.config.js@grabjs/mobile-kit-bridge-sdk from ^1.1.1 to ^2.2.2lint:check and lint:fixcheck and fix npm scripts to include linting alongside formatting.husky/pre-commit hook to run lint-staged automatically on commitprepare npm script for Husky initializationlint-staged configuration to run Prettier on all staged files.prettierrc configuration with project code style rules.prettierignore to exclude build artifacts and dependencies.editorconfig for consistent editor settings across IDEsformat:check, format:fix, check, and fix