UNPKG

@namiml/web-sdk

Version:

Nami Web SDK makes subscriptions & in-app purchases easy, with powerful built-in paywalls and A/B testing

58 lines (40 loc) 1.87 kB
![Nami SDK logo](https://cdn.namiml.com/brand/sdk/Nami-SDK@0.5x.png) # Nami Web SDK Nami is easy subscriptions & in-app purchases, with powerful built-in paywalls and A/B testing. This library helps you easily offer in-app purchases and subscriptions. - No IAP code to write. - Focus on your app experience. - All edge cases are handled and no server is required. - Includes is powerful built-in paywalls templates - Update paywalls easily using a browser-based paywall CMS. - Conduct paywall A/B tests, to improve your conversion rate. - Robust subscription analytics, webhooks, and much more. Requires an account with Nami ML. See https://www.namiml.com/pricing for more details and to create a free account. ## Getting started with Nami's Web SDK ### Install the Web SDK in your project You can install the SDK via NPM or Yarn ``` npm install @namiml/web-sdk --save ``` ``` yarn add @namiml/web-sdk ``` Example apps showing how to use the SDK are available in our [Nami Web SDK repo](https://github.com/namiml/nami-web-sdk). More information on configuring and using the SDK is available in our docs at [https://learn.namiml.com](https://learn.namiml.com). ## Legacy support To support older browsers, import our side-effect module before you import the SDK. It installs the necessary polyfills and shims, allowing the main entry point to stay the same for every app. - ESM: ```js import '@namiml/web-sdk/legacy-support'; import { Nami } from '@namiml/web-sdk'; ``` - CommonJS: ```js require('@namiml/web-sdk/legacy-support'); const { Nami } = require('@namiml/web-sdk'); ``` Modern apps that do not target legacy environments can simply import the default entry: ```js import { Nami } from '@namiml/web-sdk'; ``` This keeps the modern bundle slim, while letting you opt into additional support only when you need it.