@namiml/web-sdk 0.0.1-alpha.5 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/LICENSE +1 -0
  3. package/README.md +20 -36
  4. package/dist/nami-web.cjs +21 -10566
  5. package/dist/nami-web.d.ts +200 -57
  6. package/dist/nami-web.js +21 -10561
  7. package/dist/nami-web.mjs +21 -10561
  8. package/dist/nami-web.umd.js +21 -10572
  9. package/package.json +12 -17
  10. package/dist/components/ContextConsumer.d.ts +0 -11
  11. package/dist/components/ContextProvider.d.ts +0 -45
  12. package/dist/components/NamiElement.d.ts +0 -8
  13. package/dist/components/Paywall.d.ts +0 -11
  14. package/dist/components/TemplateComponent.d.ts +0 -3
  15. package/dist/components/containers/BackgroundContainer.d.ts +0 -12
  16. package/dist/components/containers/Container.d.ts +0 -10
  17. package/dist/components/containers/Content.d.ts +0 -11
  18. package/dist/components/containers/Footer.d.ts +0 -9
  19. package/dist/components/containers/Header.d.ts +0 -11
  20. package/dist/components/containers/ProductContainer.d.ts +0 -9
  21. package/dist/components/elements/Button.d.ts +0 -9
  22. package/dist/components/elements/Image.d.ts +0 -9
  23. package/dist/components/elements/Spacer.d.ts +0 -9
  24. package/dist/components/elements/Text.d.ts +0 -27
  25. package/dist/components/index.d.ts +0 -25
  26. package/dist/components/productDetails.d.ts +0 -1
  27. package/dist/components/styles/reset.d.ts +0 -2
  28. package/dist/components/utils.d.ts +0 -46
  29. package/dist/core/api.d.ts +0 -12
  30. package/dist/core/errors.d.ts +0 -19
  31. package/dist/core/withRetry.d.ts +0 -1
  32. package/dist/decorators/index.d.ts +0 -2
  33. package/dist/index.d.ts +0 -8
  34. package/dist/nami/api.d.ts +0 -14
  35. package/dist/nami/campaign.d.ts +0 -19
  36. package/dist/nami/customer.d.ts +0 -96
  37. package/dist/nami/index.d.ts +0 -8
  38. package/dist/nami/namiRefs.d.ts +0 -7
  39. package/dist/nami/paywalls.d.ts +0 -14
  40. package/dist/nami/profile.d.ts +0 -12
  41. package/dist/repositories/campaignRule.repository.d.ts +0 -12
  42. package/dist/repositories/config.repository.d.ts +0 -7
  43. package/dist/repositories/device.repository.d.ts +0 -12
  44. package/dist/repositories/paywall.repository.d.ts +0 -8
  45. package/dist/repositories/products.repository.d.ts +0 -8
  46. package/dist/services/logger.service.d.ts +0 -13
  47. package/dist/services/storage.service.d.ts +0 -50
  48. package/dist/types/api.d.ts +0 -15
  49. package/dist/types/campaign.d.ts +0 -16
  50. package/dist/types/components/containers.d.ts +0 -52
  51. package/dist/types/components/elements.d.ts +0 -78
  52. package/dist/types/components/index.d.ts +0 -110
  53. package/dist/types/config.d.ts +0 -32
  54. package/dist/types/device.d.ts +0 -34
  55. package/dist/types/languages.d.ts +0 -1
  56. package/dist/types/loglevel.d.ts +0 -7
  57. package/dist/types/paywall.d.ts +0 -169
  58. package/dist/types/profile.d.ts +0 -3
  59. package/dist/types/utils.d.ts +0 -1
  60. package/dist/utils/config.d.ts +0 -3
  61. package/dist/utils/const.d.ts +0 -1
  62. package/dist/utils/device.d.ts +0 -2
  63. package/dist/utils/fonts.d.ts +0 -7
package/CHANGELOG.md ADDED
@@ -0,0 +1,49 @@
1
+ # 1.0.0 (June 13, 2024)
2
+
3
+ ## Changelog
4
+
5
+ ### New Features
6
+ - **Nami** - Introduced `Nami` to provide core functionality to initialize the SDK.
7
+ - **Nami.configure** -Method to initialize and configure the SDK using a `NamiConfiguration` object.
8
+ - **NamiConfiguration** - Defines the structure of the configuration object used by `Nami.configure`.
9
+ - **NamiLanguageCodes** - Defines the languages supported by Nami paywalls.
10
+
11
+ - **NamiCampaignManager** - Introduced `NamiCampaignManager` to launch paywalls and manage campaigns.
12
+ - **NamiCampaignManager.launch** - Method to launch paywalls.
13
+ - **NamiCampaignManager.allCampaigns** - Method to get a list of available `NamiCampaign`s.
14
+ - **NamiCampaignManager.isCampaignAvailable** - Method to check if a matching campaign is available, returning a boolean.
15
+ - **NamiCampaignManager.refresh** - Method to request that available campaigns be refreshed.
16
+ - **NamiCampaignManager.registerAvailableCampaignsHandler** - Method to register a callback that is called when campaigns are updated.
17
+ - **NamiCampaign** - Defines the structure of the campaign objects.
18
+
19
+ - **NamiCustomerManager** - Introduced `NamiCustomerManager` to manager customer related functionality.
20
+ - **NamiCustomerManager.isLoggedIn** - Method to check if a customer is logged in, returning a boolean.
21
+ - **NamiCustomerManager.loggedInId** - Method to get the unique customer identifier associated with the current device.
22
+ - **NamiCustomerManager.login** - Method to provide a customer id to link one or more devices to a known customer.
23
+ - **NamiCustomerManager.logout** - Method to disassociate a device from a customer identifier.
24
+ - **NamiCustomerManager.registerAccountStateHandler** - Method to register a callback that is called when a customer is logged in or logged out.
25
+ - **NamiCustomerManager.setCustomerAttribute** - Method to set an attribute in an on-device key/value store for use for paywall personalization uses cases.
26
+ - **NamiCustomerManager.getCustomerAttribute** - Method to get the current stored value, if available, for the provided key in the on-device customer key/value store.
27
+ - **NamiCustomerManager.clearCustomerAttribute** - Method to remove a key from the on-device customer key/value store.
28
+ - **NamiCustomerManager.clearAllCustomerAttributes** - Method to clear all customer attributes in the on-device key/value store.
29
+ - **NamiCustomerManager.setAnonymousMode** - Method to set the anonymous mode for the customer.
30
+
31
+ - **NamiPaywallManager** - Introduce `NamiPaywallManager` to manage paywalls.
32
+ - **NamiPaywallManager.setProductDetails** - Method to set product and price details to be used by the paywall.
33
+ - **NamiPaywallManager.registerSignInHandler** - Method to register a callback for when the customer clicks a sign in button on the paywall.
34
+ - **NamiPaywallManager.registerCloseHandler** - Method to register a callback for when the customer clicks on a close button on the paywall.
35
+ - **NamiPaywallManager.registerDeeplinkActionHandler** - Method to register a callback for when a customer clicks on a deeplink button on the paywall.
36
+ - **NamiPaywallManager.registerBuySkuHandler** - Method to register a callback for when a customer clicks on a buy button on the paywall.
37
+ - **NamiPaywallManager.registerRestoreHandler** - Method to register a callback wfor when a customer clicks to restore a previous purchase.
38
+ - **NamiPaywallManager.buySkuComplete** - Method to notify Nami SDK when a purchase succeeded for conversion reporting.
39
+ - **NamiPaywallManager.buySkuCancel** - Method to notify Nami SDK when a user cancelled the purchase flow, or an error occurred.
40
+
41
+ ### Known Issues
42
+ - When user actions are taken on the paywall, paywall callbacks are not being called.
43
+ - `NamiPaywallManager`'s `buySkuComplete` and `buySkuCancel` methods are not fully implemented.
44
+ - `NamiCustomerManager`'s `setAnonymousMode` method is not fully implemented.
45
+ - Impression or conversion reporting not yet implemented
46
+ - Launch context is not yet implemented
47
+
48
+ ### Additional Notes
49
+ Please refer to the documentation for detailed usage instructions and examples.
package/LICENSE ADDED
@@ -0,0 +1 @@
1
+ Your use is subject to the terms of the agreement at: https://www.nami.ml/legal/tos
package/README.md CHANGED
@@ -1,52 +1,36 @@
1
- # sdk-web
1
+ ![Nami SDK logo](https://cdn.namiml.com/brand/sdk/Nami-SDK@0.5x.png)
2
2
 
3
- Nami SDK for Web Source
3
+ # Nami Web SDK
4
4
 
5
- ## Build SDK
5
+ Nami is easy subscriptions & in-app purchases, with powerful built-in paywalls and A/B testing.
6
6
 
7
- ### Install dependecies
7
+ This library helps you easily offer in-app purchases and subscriptions.
8
+ - No IAP code to write.
9
+ - Focus on your app experience.
10
+ - All edge cases are handled and no server is required.
11
+ - Includes is powerful built-in paywalls templates
12
+ - Update paywalls easily using a browser-based paywall CMS.
13
+ - Conduct paywall A/B tests, to improve your conversion rate.
14
+ - Robust subscription analytics, webhooks, and much more.
8
15
 
9
- ```
10
- npm install || yarn install
11
- ```
16
+ Requires an account with Nami. The free tier is generous and includes everything you need to get up and running.
12
17
 
13
- ### Build SDK
18
+ See https://www.namiml.com for more details and to create a free account.
14
19
 
15
- ```
16
- npm run build-sdk || yarn build-sdk
17
- ```
20
+ ## Getting started with Nami's Web SDK
18
21
 
19
- ---
22
+ ### Install the Web SDK in your project
20
23
 
21
- ## To enable pre-commit hook
24
+ You can install the SDK via NPM or Yarn
22
25
 
23
26
  ```
24
- git config core.hooksPath .githooks
27
+ npm install @namiml/web-sdk --save
25
28
  ```
26
29
 
27
- ## To see the Lit Example:
28
-
29
- In one terminal, have microbundle watch your code for changes
30
30
  ```
31
- yarn watch-modern-sdk
31
+ yarn add @namiml/web-sdk
32
32
  ```
33
33
 
34
- In another terminal:
35
- - Go to the `examples/lit` directory
36
- - Create a `nami-dist` folder (if it doesn't exist)
37
- - Create a symlink to the built SDK
38
- - Start the Web Dev Server
34
+ Example apps showing how to use the SDK are available in our [Nami Web SDK repo](https://github.com/namiml/nami-web-sdk).
39
35
 
40
- ```
41
- cd examples/lit
42
- mkdir nami-dist
43
- ln -s ../../dist/nami.modern.mjs ./nami-dist/nami.modern.mjs
44
- yarn serve
45
- ```
46
-
47
- ## Demo APPs
48
-
49
- - [Vanilla JS](https://github.com/namiml/sdk-web/blob/main/examples/vanilla-js-demo/README.md)
50
- - [React](https://github.com/namiml/sdk-web/blob/main/examples/react-demo/README.md)
51
- - [Vue](https://github.com/namiml/sdk-web/blob/main/examples/vue-demo/README.md)
52
- - [Lit](https://github.com/namiml/sdk-web/blob/main/examples/lit/README.md)
36
+ More information on configuring and using the SDK is available in our docs at [https://docs.namiml.com](https://docs.namiml.com).