{"_id":"@boltpay/bolt-connect-sdk","_rev":"8-ba029597897149484ed8c99175469ed9","name":"@boltpay/bolt-connect-sdk","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.2":{"name":"@boltpay/bolt-connect-sdk","version":"1.0.2","keywords":["bolt","bolt-connect","boltpay","ecommerce","checkout","marketplace"],"author":{"name":"Bolt"},"_id":"@boltpay/bolt-connect-sdk@1.0.2","maintainers":[{"name":"boltpay-owner","email":"integration+npm@bolt.com"},{"name":"daniel-bolt","email":"daniel.book@bolt.com"},{"name":"xwang-bolt","email":"xwang@bolt.com"}],"homepage":"https://github.com/BoltApp/bolt-connect-sdk#readme","bugs":{"url":"https://github.com/BoltApp/bolt-connect-sdk/issues"},"dist":{"shasum":"70834d18aa072bce2cad9afaa58f46ee13f5f2f3","tarball":"https://registry.npmjs.org/@boltpay/bolt-connect-sdk/-/bolt-connect-sdk-1.0.2.tgz","fileCount":8,"integrity":"sha512-YlGITxe2589YGIKfeuA7uBvJWo31h/PhfD5gVLuoRKJWIy13/2JZX5utuRveXIwB2XibQGgN3wL0T+sXYElIAw==","signatures":[{"sig":"MEYCIQCpzqJf4/uEqpcMIrYyla88/1lgBHefw9fOp+uVcvGF2QIhAI+83WJ3aDAPIu4QbACwMyBWYBBkX2HaIEqko84Y1Pir","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22854},"type":"module","types":"./build/dist/index.d.ts","module":"./build/dist/bolt-connect-sdk.js","exports":{".":{"types":"./build/dist/index.d.ts","import":"./build/dist/bolt-connect-sdk.js"},"./dist/":{"import":"./build/dist/"}},"gitHead":"da507c9fbb6b28b1e7774048dd85b5b54eb618f9","private":false,"scripts":{"dev":"vite --host","test":"vitest","build":"rimraf build/**/* && tsc && vite build && dts-bundle-generator --config ./dts-bundle-generator.config.ts && copyfiles ./package.json build","format":"npm run format:scripts && npm run format:styles","prepare":"npm run build","lint:styles":"stylelint ./**/*.{css,scss}","lint:scripts":"eslint . --ext .ts","format:styles":"stylelint ./**/*.{css,scss} --fix","test:coverage":"vitest --coverage","format:scripts":"prettier . --write","uninstall-husky":"npm uninstall husky --no-save && git config --unset core.hooksPath && npx rimraf .husky"},"_npmUser":{"name":"boltpay-owner","email":"integration+npm@bolt.com"},"repository":{"url":"git+https://github.com/BoltApp/bolt-connect-sdk.git","type":"git"},"_npmVersion":"9.5.1","description":"Bolt Connect SDK enables marketplaces to onboard their end sellers and integrate with Bolt Connect for seamless payment processing. Provides end seller onboarding and information retrieval for marketplace platforms.","directories":{},"lint-staged":{"*.{ts,tsx}":["eslint --fix","vitest related --run"],"*.{css,scss}":["stylelint --fix"]},"sideEffects":["*.css"],"_nodeVersion":"18.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jiti":"^2.4.2","vite":"^6.2.0","husky":"^9.1.7","eslint":"^9.21.0","rimraf":"^6.0.1","vitest":"^3.0.7","postcss":"^8.5.3","ts-node":"^10.9.2","prettier":"^3.5.2","copyfiles":"^2.4.1","stylelint":"^16.14.1","typescript":"^5.7.3","@types/node":"^22.13.5","lint-staged":"^15.4.3","@types/jsdom":"^21.1.7","postcss-scss":"^4.0.9","stylelint-order":"^6.0.4","typescript-eslint":"^8.25.0","stylelint-prettier":"^5.0.3","@vitest/coverage-v8":"^3.0.7","dts-bundle-generator":"^9.5.1","eslint-config-prettier":"^10.0.1","eslint-plugin-prettier":"^5.2.3","stylelint-config-recommended":"^15.0.0","stylelint-config-sass-guidelines":"^12.1.0"},"_npmOperationalInternal":{"tmp":"tmp/bolt-connect-sdk_1.0.2_1752667444859_0.23402909075694223","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-07-16T12:04:04.787Z","modified":"2026-03-30T16:20:11.727Z","1.0.0":"2025-07-16T11:08:12.125Z","1.0.1":"2025-07-16T11:14:06.909Z","1.0.2":"2025-07-16T12:04:05.087Z"},"bugs":{"url":"https://github.com/BoltApp/bolt-connect-sdk/issues"},"author":{"name":"Bolt"},"homepage":"https://github.com/BoltApp/bolt-connect-sdk#readme","keywords":["bolt","bolt-connect","boltpay","ecommerce","checkout","marketplace"],"repository":{"url":"git+https://github.com/BoltApp/bolt-connect-sdk.git","type":"git"},"description":"Bolt Connect SDK enables marketplaces to onboard their end sellers and integrate with Bolt Connect for seamless payment processing. Provides end seller onboarding and information retrieval for marketplace platforms.","maintainers":[{"email":"integration+npm@bolt.com","name":"boltpay-owner"}],"readme":"# Bolt Connect SDK\n\n[![npm version](https://img.shields.io/npm/v/@boltpay/bolt-connect-sdk.svg)](https://www.npmjs.com/package/@boltpay/bolt-connect-sdk)\n\nThe Bolt Connect SDK enables marketplaces to seamlessly onboard their sellers and integrate with Bolt Connect for seamless payment processing. This SDK provides two main functionalities:\n\n1. **Seller Onboarding**: Streamlined iframe-based onboarding process for marketplace sellers\n2. **Seller Information Retrieval**: API helpers to fetch onboarding status and merchant information for Bolt Connect integration\n\n## Features\n\n- 🚀 **Seamless Onboarding**: Full-screen iframe integration for seller onboarding\n- 🔒 **Secure**: Secure communication between SDK and Bolt's backend\n- 💾 **Caching**: Intelligent caching for API responses to improve performance\n- 🎯 **TypeScript Support**: Full TypeScript definitions included\n- 🔧 **Configurable**: Flexible configuration for both production and sandbox environments\n\n## Installation\n\n### Using npm\n\n```bash\nnpm install @boltpay/bolt-connect-sdk\n```\n\n### Using yarn\n\n```bash\nyarn add @boltpay/bolt-connect-sdk\n```\n\n### Using pnpm\n\n```bash\npnpm add @boltpay/bolt-connect-sdk\n```\n\n### Using bun\n\n```bash\nbun add @boltpay/bolt-connect-sdk\n```\n\n### Direct download from npm registry\n\nYou can also download the package directly from the npm registry:\n\n- **Package info**: `https://registry.npmjs.org/@boltpay/bolt-connect-sdk`\n\n## Quick Start\n\n### 1. Import the SDK\n\n```typescript\nimport { Onboarding, CheckoutHelpers } from '@boltpay/bolt-connect-sdk'\n```\n\n### 2. Configure Onboarding\n\n```typescript\n// Configure the onboarding with your credentials\nOnboarding.configure(\n  {\n    publishableKey: 'your-publishable-key',\n    marketplaceSubMerchantID: 'unique-seller-identifier-in-your-platform', // unique identifier for the seller in your platform\n    isTestEnv: true, // (Optional) Set to true for sandbox\n  },\n  {\n    onSuccess: () => {\n      console.log('Onboarding completed successfully!')\n      // Handle successful onboarding (e.g., redirect, show success message)\n    },\n    onFailure: payload => {\n      console.error('Onboarding failed:', payload.message)\n      // Handle onboarding failure (e.g., show error message)\n    },\n    // optional\n    onNotify: payload => {\n      console.log('Onboarding notification:', payload.message)\n      // Handle notifications during onboarding process\n    },\n  }\n)\n```\n\n### 3. Start Onboarding\n\n```typescript\n// Start the onboarding process\nconst startOnboarding = async () => {\n  try {\n    // you can start displaying loading animation of your own\n    await Onboarding.start()\n    // The iframe will be displayed full-screen\n  } catch (error) {\n    console.error('Failed to start onboarding:', error)\n  } finally {\n    // you can stop displaying loading animation\n  }\n}\n\n// Attach to a button click\ndocument\n  .getElementById('onboarding-button')\n  ?.addEventListener('click', startOnboarding)\n```\n\n### 4. Get Seller Information\n\n```typescript\n// Fetch seller information\nconst getSellerInfo = async () => {\n  try {\n    const sellerInfo = await CheckoutHelpers.getSellerInfo({\n      publishableKey: 'your-publishable-key',\n      marketplaceSubMerchantID: 'unique-seller-identifier-in-your-platform',\n      isTestEnv: true, // (Optional) Set to true for sandbox\n    })\n  } catch (error) {\n    console.error('Failed to fetch seller info:', error)\n  }\n}\n```\n\n## API Reference\n\n### Onboarding\n\n#### `Onboarding.configure(clientProps, eventHandlers)`\n\nConfigures the onboarding process with your credentials and event handlers.\n\n**Parameters:**\n\n- `clientProps` (ClientProps):\n\n  - `publishableKey` (string): Your Bolt publishable key\n  - `marketplaceSubMerchantID` (string): Unique identifier of the seller in your platform\n  - `isTestEnv` (boolean, optional): Set to `true` for sandbox environment, `false` for production (default: `false`)\n\n- `eventHandlers` (OnboardingCallbacks):\n  - `onSuccess?` (() => void): Called when onboarding completes successfully\n  - `onFailure?` ((payload: { message: string }) => void): Called when onboarding fails\n  - `onNotify?` ((payload: { message: string }) => void): Called for notifications during onboarding\n\n#### `Onboarding.start(): Promise<void>`\n\nStarts the onboarding process by displaying the iframe full-screen.\n\n#### `Onboarding.end(): void`\n\nCloses the onboarding iframe and cleans up resources. In general, sellers have the option to exit the onboarding, but marketplace can forcefully end the session using this function.\n\n### CheckoutHelpers\n\n#### `CheckoutHelpers.getSellerInfo(params): Promise<SellerInfoResponse>`\n\nFetches seller information including onboarding status.\n\n**Parameters:**\n\n- `params` (GetSellerInfoParams):\n  - `publishableKey` (string): Your Bolt publishable key\n  - `marketplaceSubMerchantID` (string): Unique seller identifier in your platform\n  - `isTestEnv` (boolean, optional): Set to `true` for sandbox environment (default: `false`)\n\n**Returns:**\n\n- `SellerInfoResponse`:\n  - `publishableKey` (string): The publishable key of the seller\n  - `onboardingStatus` ('completed' | 'unconfigured' | 'under_review'): Current onboarding status of the seller with Bolt Connect\n\n## Environment Configuration\n\n### Production Environment\n\n```typescript\nconst config = {\n  publishableKey: 'your-production-publishable-key',\n  marketplaceSubMerchantID: 'unique-seller-identifier-in-your-platform',\n  isTestEnv: false, // Production environment\n}\n```\n\n### Sandbox Environment\n\n```typescript\nconst config = {\n  publishableKey: 'your-sandbox-publishable-key',\n  marketplaceSubMerchantID: 'unique-seller-identifier-in-your-platform',\n  isTestEnv: true, // Sandbox environment\n}\n```\n\n## Error Handling\n\nThe SDK provides comprehensive error handling:\n\n```typescript\ntry {\n  await Onboarding.start()\n} catch (error) {\n  // Handle iframe creation/display errors\n  console.error('Onboarding error:', error)\n}\n\ntry {\n  const sellerInfo = await CheckoutHelpers.getSellerInfo(params)\n} catch (error) {\n  // Handle API errors (network, authentication, etc.)\n  console.error('API error:', error)\n}\n```\n\n## Browser Support\n\nThe SDK supports all modern browsers with ES6+ support:\n\n- Chrome 60+\n- Firefox 55+\n- Safari 12+\n- Edge 79+\n\n## Support\n\nFor support and questions:\n\n- 📧 Email: support@bolt.com\n- 📚 Documentation: [Bolt Connect Docs](https://help.bolt.com/products/bolt-connect/)\n\n## Changelog\n\n### v1.0.0\n\n- **Stable Release**: Production-ready marketplace SDK\n- **Seller Onboarding**: Full-screen iframe integration with secure communication\n- **Seller Information Retrieval**: API helpers for retrieving seller information\n- **TypeScript Support**: Complete type definitions for all interfaces\n- **Environment Support**: Production and sandbox environment configuration\n- **Error Handling**: Comprehensive error handling and validation\n- **Performance**: Caching for API responses\n- **Security**: Origin validation and secure iframe communication\n\n<div class=\"discord-link\">\n    Got Questions?\n    <a href=\"https://discord.gg/BSUp9qjtnc\" target=\"_blank\" class=\"discord-link-anchor\">\n      <span class=\"discord-text mr-2\">Chat with us on Discord</span>\n      <span class=\"discord-icon-wrapper\">\n        <img src=\"https://help.bolt.com/images/brand/Discord-Symbol-White.svg\" alt=\"Discord\" class=\"discord-icon\" width=\"15px\">\n      </span>\n    </a>\n</div>\n","readmeFilename":"README.md"}