@grabjs/superapp-sdk
    Preparing search index...

    Changelog

    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.

    • BREAKING: Renamed DeviceCapabilityModule to DeviceModule for brevity
      • Import path changed from modules/device-capability to modules/device
      • Class name changed from DeviceCapabilityModule to DeviceModule
      • Update your imports: import { DeviceModule } from '@grabjs/superapp-sdk'
    • README updated to reflect the module rename
    • 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 existence
    • guides/ai-assistance.md — setup guide for AI-assisted development with Cursor and Claude
    • valibot moved from devDependencies to dependencies (runtime requirement for schema validation)
    • GetCoordinateResult properties renamed from lat/lng to latitude/longitude for consistency
    • Consolidated all module exports in src/index.ts to use barrel exports (cleaner imports from module index files)
    • Updated JSDoc examples and SKILL.md to reflect coordinate property rename
    • build-skills.mjs excludes ai-assistance.md from skill generation (setup guide, not conceptual)
    • README.md — added link to AI-Assisted Development documentation
    • Logger utility class for scoped logging ([SuperAppSDK][ModuleName.method]) across all SDK modules
    • VerifyEmailResult schema and type export for email verification responses
    • ProfileModule.verifyEmail() now accepts optional request parameters and returns the verified email in result
    • VerifyEmailRequest type updated to use skipUserInput instead of otp for native bottom sheet flow
    • TriggerCheckoutResult documentation improved with clearer status-to-field mapping
    • All modules migrated from direct console.warn to the new Logger utility for validation warnings
    • Core schemas refactored: consolidated error status code types under BridgeErrorStatusCode
    • bridgeSuccessSchema function (superseded by bridgeOkSchema)
    • CheckoutModule — added important disclaimers to method and type documentation; added note that mobile scope is required
    • LocaleModule — added list of supported locales to SupportedLocale type documentation
    • LocationModulegetCountryCode now correctly returns result as a plain string (e.g. 'SG') instead of an object { countryCode: string }; updated GetCountryCodeResult type, schema, and documentation accordingly
    • StorageModule — added note that stored data is cleared when the user logs out
    • guides/concepts.md — new Core Concepts guide covering the response pattern, status codes, type guards, and streams
    • README slimmed to overview, module index, and documentation links — detailed content moved to guides
    • guides/setup.md — moved environment requirements to Core Concepts guide
    • skills/SKILL.md — guides now ordered explicitly (Setup → Core Concepts → Integration Guide); Classes and Functions wrapped under ## API Reference
    • scripts/skills-template.md — reduced to frontmatter and intro; all content lives in guides
    • Consolidated AI skills into single skills/SKILL.md file with inlined guides and API references
    • build-skills.mjs now generates unified skill file instead of separate directories
    • skills/guides/ directory (guides now inlined into SKILL.md)
    • skills/references/ directory (classes and functions now inlined into SKILL.md)
    • AI IDE integration (Skills) for Claude with skills/SKILL.md metadata and documentation
    • build-skills.mjs script to generate skill references from TypeDoc API
    • skills/references/ with generated class and function documentation for AI context
    • skills/guides/ with setup and integration guides for AI-assisted development
    • skills directory included in npm package files
    • Build script now generates skill documentation after docs build
    • ESLint configuration updated to handle skills directory
    • Runtime schema validation using valibot for all module requests and responses
    • Schema files (schemas.ts) for all modules with valibot validation schemas
    • validate() protected method to BaseModule for pre-invocation validation
    • requestSchema and responseSchema options to InvokeOptions interface
    • formatIssues() utility for human-readable validation error formatting
    • typedoc-plugin-valibot dev dependency for schema documentation
    • isOk(), isNoContent(), isFound() type guards for granular status code narrowing
    • valibot added as peer dependency (replaces @grabjs/mobile-kit-bridge-sdk peer dependency)
    • @grabjs/mobile-kit-bridge-sdk moved from peerDependencies to devDependencies
    • invoke() and invokeStream() methods now perform automatic request/response validation when schemas are provided
    • isErrorResponse() type guard renamed to isError() for consistency
    • Simplified core types by removing redundant status code type hierarchies
    • All modules updated to use schema-based validation with proper error responses on validation failures
    • Legacy status code type definitions (BridgeStatusCode, BridgeError, BridgeSuccessResponse, etc.)
    • Redundant response type aliases (ResponseStatusCode200, ResponseStatusCode204, etc.)
    • Complex generic type hierarchies in favor of schema-driven validation
    • SplashScreenModule, the native splash / Lottie loading screen
    • Updated all JSDoc examples across modules to use isSuccess() and isErrorResponse() type guards instead of switch-case patterns
    • BaseModule.invoke() changed from public to protected visibility
    • Enhanced error messages in BaseModule.invoke() and BaseModule.invokeStream() to include actual error details
    • Fixed template literal syntax in BaseModule constructor error message
    • Legacy TypeDoc markdown documentation files from typedoc/ directory
    • Exported isErrorWithMessage() utility from main entry point
    • Exported InvokeOptions type from main entry point
    • Markdown API reference generation to api-reference/markdown/ directory
    • typedoc-plugin-markdown dev dependency for Markdown documentation output
    • typedoc.md.json configuration for Markdown doc generation
    • api-reference directory included in npm package files
    • Complete README.md rewrite with modern structure, installation guides, and usage examples
    • Updated maintainers list in package.json
    • TypeDoc JSON output moved to api-reference/json/api.json
    • Build process now generates both JSON and Markdown API documentation
    • Regenerated HTML documentation in /docs
    • typedoc-plugin-no-inherit dev dependency for cleaner API documentation
    • @noInheritDoc and @hidden TSDoc tags support in tsdoc.json
    • Generate documentation HTML static website in /docs
    • All module classes now use @noInheritDoc to exclude inherited BaseModule documentation
    • BaseModule class marked with @hidden to exclude from public API docs
    • DeviceCapabilityModule with isEsimSupported() support, exported response/result types, unit tests, and manual documentation
    • UserAttributesModule with getSelectedTravelDestination() support, exported response/result types, unit tests, and manual documentation
    • New InvokeOptions interface for flexible method invocation configuration
    • Type guard functions in guards.ts for runtime BridgeResponse type narrowing
    • HTTP 426 status code support for upgrade required responses
    • Consolidated core types into single src/core/types.ts file
    • Renamed response types for consistency
    • Renamed stream types for consistency
    • Simplified status code type names
    • FileModule for downloading files via the native bridge (downloadFile method)
    • DownloadFileRequest and DownloadFileResponse types for file operations
    • Unit tests for FileModule
    • BaseModule.invoke() now returns errors via status_code instead of throwing
    • Updated all module JSDoc examples to remove try-catch patterns
    • Removed @throws annotations from all module methods
    • AuthorizationConfigurationError class for identity authorization failures
    • detectGrabApp() utility for automatic Grab app detection from user agent
    • isRunningInGrabApp() utility to check if code runs inside Grab app webview
    • Unit test suites for platform, error, and version utilities
    • Refactored error utilities: replaced getErrorMessage() and errorHasMessage() with isErrorWithMessage() type guard
    • Platform utilities now auto-detect user agent from window.navigator
    • IdentityModule uses AuthorizationConfigurationError for configuration failures
    • user-agent utility directory (replaced by platform utilities)
    • getErrorMessage() and errorHasMessage() functions (use isErrorWithMessage() instead)
    • Comprehensive unit test suites for all SDK modules with 100% coverage
    • Test configuration for streaming methods with DataStream assertions
    • All module response types now include HTTP 500 status code for internal server errors
    • GetAuthorizationArtifactsResult type no longer nullable, always returns object structure
    • ESLint configuration to properly handle test file patterns
    • Vitest testing framework with jsdom environment for unit testing
    • Test coverage configuration (v8 provider with text and html reporters)
    • First unit test suite for CameraModule.scanQRCode() method
    • npm scripts: test, test:check, and test:watch for running tests
    • build:watch npm script for development workflow
    • ESLint config now includes rules for test files (**/*.test.ts) with relaxed type safety for mocks
    • ESLint config now applies copyright header checks to config files
    • Updated .prettierignore and ESLint ignore patterns to exclude coverage/ directory
    • Updated check npm script to include test:check
    • Type guard functions (isSuccess, isRedirection, isClientError, isServerError, isErrorResponse) for runtime BridgeResponse type checking
    • BaseModule.invoke() now returns Promise<BridgeResponse<T>> | DataStream<T> with proper error handling
    • All module methods refactored to be async with typed Promise return values
    • Renamed BridgeRedirectResponse to BridgeRedirectionResponse for naming consistency
    • Simplified success response structure by omitting error: null fields
    • Cleaned up redundant import examples from JSDoc comments across all modules
    • WrappedModule.invoke() signature simplified for better type inference
    • New HTTP status code response types: BridgeStatusCode401Response and BridgeStatusCode501Response
    • Error utility functions (getErrorMessage, errorHasMessage) in src/utils/error/
    • BaseModule.invoke() method with automatic Grab app environment checking
    • All modules now use this.invoke() instead of this.wrappedModule.invoke() for automatic environment detection
    • JSDoc examples updated to use switch (response.status_code) pattern instead of type guards
    • Response type exports reorganized alphabetically in src/index.ts
    • Type guard functions (isResponseOk, isResponseError, isResponseSuccess, etc.) - use response.status_code checks instead
    • TypeDoc documentation for removed type guard functions
    • New crypto utilities (src/utils/crypto/) using native Web Crypto API for PKCE operations
    • Centralized Identity constants in src/modules/identity/constants.ts
    • resources/copyright.txt for shared license header content
    • IdentityModule refactored to use new crypto utilities and centralized constants
    • generatePKCEArtifacts() is now async to support native crypto.subtle digest
    • ESLint config references resources/copyright.txt directly instead of JS import
    • Rollup config reads copyright banner from file directly
    • Moved @grabjs/mobile-kit-bridge-sdk from dependencies to devDependencies
    • crypto-js dependency (replaced by native Web Crypto API)
    • scripts/constants.mjs (superseded by resources/copyright.txt)
    • Auto-generated TypeDoc documentation for IdentityModule
    • Replaced crypto-js with native Web Crypto API for improved security and reduced bundle size
    • TypeScript ESLint support with typescript-eslint for type-aware linting
    • Add ESLint rule to check copyrights
    • SendAnalyticsEventRequest.data type changed from Record<string, any> to Record<string, unknown>
    • BaseModule initialization errors now include the original error as cause
    • Unused *Result type imports from Camera, Checkout, Identity, Profile, Scope, Storage, and SystemWebViewKit modules
    • Window interface extensions for Wrapped modules (moved to consumer side)
    • Core response type guard functions (isResponseOk, isResponseError, isResponseSuccess, isResponseClientError, isResponseServerError, etc.) for runtime response type checking
    • Response type definitions for all remaining modules: Camera, Checkout, Container, Locale, Location, Media, Platform, Scope, Storage, SystemWebViewKit
    • Exported all new response types and type guards from main entry point
    • All module methods now return typed Promise<Response> instead of Promise<any>
    • TypeScript type definitions and JSDoc documentation for IdentityModule (authorize, getAuthorizationArtifacts, clearAuthorizationArtifacts methods)
    • TypeScript type definitions and JSDoc documentation for ProfileModule (fetchEmail, verifyEmail methods)
    • TypeScript type definitions and JSDoc documentation for SystemWebViewKitModule (redirectToSystemWebView method)
    • Exported all new types from main entry point (src/index.ts) and module barrel exports
    • Generated updated TypeDoc documentation with new type aliases for Identity, Profile, and SystemWebViewKit modules
    • ScopeModule.hasAccessTo() now accepts separate (module, method) parameters instead of HasAccessToRequest object
    • ContainerModule.isConnected() refactored to use isRunningInGrabApp() utility
    • IdentityModule.shouldUseWebConsent() and ProfileModule.isSupported() refactored to use new platform utilities
    • StorageModule methods now accept individual parameters (key, value) instead of object parameters ({key, value}) to match the existing public API
    • HasAccessToRequest type (replaced by direct parameters)
    • SetBooleanRequest, SetIntRequest, SetStringRequest, SetDoubleRequest types (methods now use direct parameters)
    • IdentityModule.parseGrabUserAgent() and isVersionBelow() static methods
    • ProfileModule.parseGrabUserAgent() and isVersionBelow() static methods
    • Related TypeDoc documentation for removed methods
    • TypeScript type definitions and JSDoc documentation for LocaleModule
    • TypeScript type definitions and JSDoc documentation for ScopeModule (hasAccessTo, reloadScopes methods)
    • Comprehensive TypeScript type definitions and JSDoc documentation for StorageModule (all storage operations: boolean, int, string, double, remove, removeAll)
    • Added *Result types for all ContainerModule response types for better type consistency
    • Exported all new types from main entry point (src/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 parameters
    • All ContainerModule response types now use dedicated *Result types instead of null
    • CheckoutModule types and documentation for triggerCheckout() method
    • Exported TriggerCheckoutRequest, TriggerCheckoutResponse, and TriggerCheckoutResult types
    • Improved type safety in WrappedModule.invoke() with conditional return types for streaming methods
    • Removed redundant type assertions across CameraModule, ContainerModule, and LocationModule
    • Standardized response structure in ContainerModule.isJSBridgeConnected() to include result: null in all branches
    • LocationModule types and documentation
    • DataStream support to WrappedModule.invoke()
    • ContainerModule API methods now correctly accept primitive values
    • Added TypeDoc JSON API documentation generation
    • Added TSDoc configuration (tsdoc.json) to support custom @group tags
    • Added @group Modules tags to all module classes for better TypeDoc organization
    • Updated TypeDoc documentation structure to prioritize Modules section over Classes
    • Added wrappedModule getter to BaseModule for consistent JSBridge module access
    • Added WrappedModule interface and exported it from main entry point
    • Added comprehensive TypeScript type definitions for ContainerModule
    • Added extensive JSDoc documentation to ContainerModule with usage examples for all methods
    • Added centralized global type definitions in src/types/global.ts:
    • Exported all ContainerModule types from main src/index.ts entry point
    • Exported CameraModule types from main src/index.ts entry point
    • Generated updated TypeDoc documentation with new ContainerModule types and detailed method documentation
    • Refactored all modules to use this.wrappedModule.invoke() instead of direct window.Wrapped*Module!.invoke access
    • Changed IdentityModule.performNativeAuthorization() from static to instance method
    • Refactored src/modules/container/types.ts to replace inline WrappedContainerModule interface with granular type definitions
    • Updated ContainerModule methods to use typed request/response parameters instead of generic any types
    • Improved type safety across all ContainerModule methods with proper TypeScript typing
    • Simplified individual module index.ts barrel exports by removing duplicate type re-exports (now centralized in main index.ts)
    • Fixed TypeScript type definitions to use consistent BridgeResponse<T> patterns across all container methods
    • Resolved type redundancy by consolidating global Window interface declarations in a single location
    • Refactored src/modules/container/types.ts to replace inline WrappedContainerModule interface with granular type definitions
    • Updated ContainerModule methods to use typed request/response parameters instead of generic any types
    • Improved type safety across all ContainerModule methods with proper TypeScript typing
    • Simplified individual module index.ts barrel exports by removing duplicate type re-exports (now centralized in main index.ts)
    • Fixed TypeScript type definitions to use consistent BridgeResponse<T> patterns across all container methods
    • Resolved type redundancy by consolidating global Window interface declarations in a single location
    • Added TypeDoc documentation generation with Markdown output
      • Added typedoc and typedoc-plugin-markdown dev dependencies
      • Added typedoc.json configuration for documentation generation
      • Added build:docs npm script to generate API documentation
      • Generated comprehensive API docs in typedoc/ directory covering all modules and types
    • Updated build script to include both JS build and documentation generation
    • Updated CI build step to use build:js instead of build to avoid generating docs in CI pipeline
    • Enhanced lint-staged configuration to run ESLint on staged JavaScript and TypeScript files
    • Fixed JSDoc type parameter tag from @typeparam to @typeParam in src/core/stream/types.ts
    • Added TypeScript type definitions for Camera QR code scanning:
      • ScanQRCodeRequest - Configuration options for QR code scanning
      • ScanQRCodeResponse - Typed response from QR code scan operation
      • ScanQRCodeResult - Result object containing the scanned QR code data
    • Added comprehensive JSDoc documentation with usage examples for CameraModule.scanQRCode()
    • Exported camera types from main index and module barrel export
    • Renamed npm scripts for consistency:
      • format:checkcheck:format
      • format:fixfix:format
      • lint:checkcheck:lint
      • lint:fixfix:lint
    • Updated check and fix scripts to use renamed sub-scripts
    • Fixed JSDoc comment formatting in checkout/types.ts
    • Removed @rollup/plugin-alias dependency (no longer needed)
    • Added BaseModule abstract class in src/core/module/ for unified module initialization
    • Added core type definitions for bridge responses (src/core/response/types.ts)
    • Added core type definitions for data streams (src/core/stream/types.ts)
    • Added organized module structure with each module in its own directory under src/modules/
    • Added TypeScript type definition files for all modules:
      • CameraModule, CheckoutModule, ContainerModule, IdentityModule
      • LocaleModule, LocationModule, MediaModule, PlatformModule
      • ProfileModule, ScopeModule, StorageModule, SystemWebViewKitModule
    • Added barrel exports (index.ts) for all module directories for cleaner imports
    • Added ContainerAnalyticsEventState, ContainerAnalyticsEventName, ContainerAnalyticsEventData constants
    • Refactored all modules to extend BaseModule class for consistent initialization
    • Migrated remaining JavaScript modules to TypeScript:
      • ContainerModule.jssrc/modules/container/ContainerModule.ts
      • IdentityModule.jssrc/modules/identity/IdentityModule.ts
      • ProfileModule.jssrc/modules/profile/ProfileModule.ts
      • StorageModule.jssrc/modules/storage/StorageModule.ts
    • Reorganized source structure from flat src/ to feature-based src/modules/{name}/ layout
    • Updated src/index.ts exports to reflect new module paths
    • Deleted legacy flat JavaScript module files from src/ root:
      • CameraModule.js, CheckoutModule.js, LocaleModule.js, LocationModule.js
      • MediaModule.js, PlatformModule.js, ScopeModule.js, SystemWebViewKitModule.js
    • Full TypeScript support with type definitions
    • Added tsconfig.json for TypeScript compilation configuration
    • Added scripts/build.mjs for orchestrated build process
    • Added Microsoft API Extractor for bundling type definitions
    • Added dual module format support (ESM and CommonJS) via exports field
    • Added module field for ESM entry point
    • Added types field pointing to bundled type definitions
    • Added .nvmrc specifying Node.js version 24
    • Added clean npm script for removing build artifacts
    • Added TypeScript-related dependencies: typescript, tslib, @rollup/plugin-typescript, @types/node
    • Migrated source code from JavaScript to TypeScript (src/index.jssrc/index.ts)
    • Migrated build system from Babel to TypeScript with Rollup
    • Upgraded Rollup from 1.7.0 to 4.59.0 with modern official plugins
    • Updated build script to use new scripts/build.mjs orchestrator
    • Updated package files field to only include dist directory
    • Changed Rollup configuration from CommonJS to ES Module format (rollup.config.mjs)
    • Updated ESLint configuration to support TypeScript file extensions
    • Removed Babel and related configuration (.babelrc)
    • Removed legacy Rollup plugins: rollup-plugin-babel, rollup-plugin-commonjs, rollup-plugin-node-resolve, rollup-plugin-uglify
    • Removed docs directory from published package files
    • Deleted legacy rollup.config.js
    • Upgraded @grabjs/mobile-kit-bridge-sdk from ^1.1.1 to ^2.2.2
    • Added ESLint 10.0.2 with flat config (eslint.config.mjs)
    • Added support for linting JavaScript, JSON, and Markdown files
    • Added npm scripts: lint:check and lint:fix
    • Updated check and fix npm scripts to include linting alongside formatting
    • Added error cause when throwing authorization configuration errors
    • Added error logging for redirectUri validation failures
    • Restructured CI pipeline into 4 stages: install, check, build, publish
    • Updated package version from 1.8.8 to 1.8.9
    • Added Husky 9.1.7 for Git hooks management
    • Added lint-staged 16.3.1 for running linters on staged files
    • Added .husky/pre-commit hook to run lint-staged automatically on commit
    • Added prepare npm script for Husky initialization
    • Added lint-staged configuration to run Prettier on all staged files
    • Updated package version from 1.8.7 to 1.8.8
    • Added Prettier 3.8.1 for code formatting
    • Added .prettierrc configuration with project code style rules
    • Added .prettierignore to exclude build artifacts and dependencies
    • Added .editorconfig for consistent editor settings across IDEs
    • Added npm scripts: format:check, format:fix, check, and fix
    • Reformatted all source files with Prettier for consistent code style
    • Updated package version from 1.8.6-beta.1 to 1.8.7