@sesamy/sesamy-js 1.57.0 → 1.58.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.
- package/README.md +10 -9
- package/dist/sesamy-js.cjs +7 -6
- package/dist/sesamy-js.d.ts +2 -2
- package/dist/sesamy-js.iife.js +7 -6
- package/dist/sesamy-js.mjs +4167 -3172
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -174,7 +174,6 @@ These are the available configuration options, with their default values:
|
|
|
174
174
|
domain: null, // Optional: custom Auth0 domain (e.g., 'auth.example.com')
|
|
175
175
|
domains: [] // Optional: array of auth domain strings for multi-domain setups
|
|
176
176
|
},
|
|
177
|
-
enablePaywallSettingsUrlFallback: false, // Optional: enable fallback to sesamy-paywall settings-url
|
|
178
177
|
content: [
|
|
179
178
|
{
|
|
180
179
|
type: 'article',
|
|
@@ -185,6 +184,7 @@ These are the available configuration options, with their default values:
|
|
|
185
184
|
currency: 'USD'
|
|
186
185
|
},
|
|
187
186
|
paywallUrl: 'https://example.com/paywall', // Optional: custom paywall URL
|
|
187
|
+
enablePaywallSettingsUrlFallback: false, // Optional: enable fallback to sesamy-paywall settings-url
|
|
188
188
|
selectors: {
|
|
189
189
|
article: { selector: 'article' },
|
|
190
190
|
image: { selector: 'img', attribute: 'src' },
|
|
@@ -195,9 +195,9 @@ These are the available configuration options, with their default values:
|
|
|
195
195
|
url: { selector: 'link', attribute: 'href' },
|
|
196
196
|
id: { selector: 'article', attribute: 'data-id' },
|
|
197
197
|
pass: { selector: 'article', attribute: 'data-pass' },
|
|
198
|
+
}
|
|
198
199
|
}
|
|
199
|
-
|
|
200
|
-
],
|
|
200
|
+
],
|
|
201
201
|
tranforms: {
|
|
202
202
|
enabled: false,
|
|
203
203
|
rules: []
|
|
@@ -1105,7 +1105,7 @@ Creates a checkout session with Sesamy. This function initializes a checkout pro
|
|
|
1105
1105
|
- payerEmail (string, optional): Email of the payer (person paying for the purchase).
|
|
1106
1106
|
- requireAddress (boolean, optional): If true, requires the customer to provide an address during checkout.
|
|
1107
1107
|
- giftMode (boolean, optional): If true, enables gift mode for the checkout.
|
|
1108
|
-
-
|
|
1108
|
+
- metadata (Record<string, string>, optional): Custom metadata to store with the checkout (e.g., { "campaign": "summer2024", "source": "mobile" }).
|
|
1109
1109
|
|
|
1110
1110
|
### Returns
|
|
1111
1111
|
|
|
@@ -1198,6 +1198,8 @@ const checkout = await sesamy.checkouts.create({
|
|
|
1198
1198
|
giftMessage: 'Happy Birthday!',
|
|
1199
1199
|
giftFrom: 'John',
|
|
1200
1200
|
},
|
|
1201
|
+
});
|
|
1202
|
+
```
|
|
1201
1203
|
|
|
1202
1204
|
### Additional Notes
|
|
1203
1205
|
|
|
@@ -1639,10 +1641,11 @@ Each field object contains the following properties:
|
|
|
1639
1641
|
|
|
1640
1642
|
#### `enablePaywallSettingsUrlFallback`
|
|
1641
1643
|
|
|
1642
|
-
**Type:** `boolean`
|
|
1644
|
+
**Type:** `boolean`
|
|
1643
1645
|
**Default:** `false`
|
|
1646
|
+
**Location:** Per content node in `content[].enablePaywallSettingsUrlFallback`
|
|
1644
1647
|
|
|
1645
|
-
When enabled, this feature flag allows the content module to fall back to checking for a `settings-url` attribute on `<sesamy-paywall>` elements when no `paywallUrl` is found through the standard detection methods (meta tags or article attributes).
|
|
1648
|
+
When enabled on a content node, this feature flag allows the content module to fall back to checking for a `settings-url` attribute on `<sesamy-paywall>` elements when no `paywallUrl` is found through the standard detection methods (meta tags or article attributes).
|
|
1646
1649
|
|
|
1647
1650
|
**Use Case:** This is useful for pages that use the `<sesamy-paywall>` custom element but don't explicitly set the paywall URL in meta tags or on the article element. The paywall component may have a `settings-url` attribute that points to the paywall configuration.
|
|
1648
1651
|
|
|
@@ -1659,10 +1662,10 @@ When enabled, this feature flag allows the content module to fall back to checki
|
|
|
1659
1662
|
// Enable the fallback feature
|
|
1660
1663
|
{
|
|
1661
1664
|
clientId: "demo",
|
|
1662
|
-
enablePaywallSettingsUrlFallback: true,
|
|
1663
1665
|
content: [
|
|
1664
1666
|
{
|
|
1665
1667
|
type: 'article',
|
|
1668
|
+
enablePaywallSettingsUrlFallback: true,
|
|
1666
1669
|
selectors: {
|
|
1667
1670
|
article: { selector: 'sesamy-article' }
|
|
1668
1671
|
}
|
|
@@ -2888,5 +2891,3 @@ const consumeUrl = client.links.generateConsumeLink(
|
|
|
2888
2891
|
|
|
2889
2892
|
- **sesamy-js `generateLink`**: Includes authentication token in hash if user is authenticated, automatically includes tracking cookies and attribution data, supports link shortening via TTL
|
|
2890
2893
|
- **SDK `links.*`**: Pure URL generation without authentication, useful for generating shareable links, links for unauthenticated users, or backend link generation
|
|
2891
|
-
|
|
2892
|
-
````
|