@sesamy/sesamy-js 1.30.1 → 1.31.1

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 CHANGED
@@ -46,7 +46,7 @@ The following methods are available on the `sesamy` object:
46
46
  - signedLinks: lists and signedLinks registered in the current session
47
47
  - fulfillments
48
48
  - list: list the user's fulfillments for a SKU
49
- - generateLink: creates a link to a Sesamy hosted service such as account, consume, or checkout. If the user is authenticated, the link will be signed so that the user can access the service without logging in again.
49
+ - generateLink: creates a link to a Sesamy hosted service such as account, change-payment, consume, or checkout. If the user is authenticated, the link will be signed so that the user can access the service without logging in again.
50
50
  - getPaymentIssues: returns a list of failed payments and cards that will expire
51
51
  - getVersion: returns the version of the sesamy-js library
52
52
  - init: Initializes the sesamy-js library
@@ -562,20 +562,37 @@ export type Address = {
562
562
  };
563
563
  ```
564
564
 
565
- ## `generateLink(params: GenerateAccountLink | GenerateConsumeLink)`
565
+ ## `generateLink(params: GenerateAccountLink | GenerateChangePaymentLink | GenerateConsumeLink | GenerateCheckoutLink)`
566
566
 
567
567
  Generates a link to a Sesamy-hosted service such as account or consume. If the user is authenticated, the link will be signed so that the user can access the service without logging in again.
568
568
 
569
569
  ### Parameters
570
570
 
571
- - params (GenerateAccountLink | GenerateConsumeLink): The parameters for generating the link.
572
- - target (string): The target service, either 'account' or 'consume'.
573
- - sku (string, required for 'consume' target): The SKU of the product to consume.
574
- - episodeId (string, optional for 'consume' target): The ID of the episode to consume.
575
- - shorten (boolean, optional): If true, the link will be shortened.
576
- - ttl (number, optional): The time-to-live for the shortened link in seconds.
577
- - redirectUrl (string, optional): The URL to redirect to after the link is accessed.
578
- - language (string, optional): The language for the link. If not provided the language will be fetched from the HTML element's `lang` attribute.
571
+ - params (GenerateAccountLink | GenerateConsumeLink):
572
+
573
+ - The parameters for generating the link.
574
+ attribute.
575
+ Common parameters:
576
+
577
+ - target (string, required): The target service. Valid values:
578
+ - 'account': Generate link to account page
579
+ - 'change-payment': Generate link to payment change page
580
+ - 'consume': Generate link to consume content
581
+ - 'checkout': Generate link to checkout page
582
+ - shorten (boolean, optional): If true, the link will be shortened
583
+ - ttl (number, optional): The time-to-live for the shortened link in seconds
584
+ - redirectUrl (string, optional): The URL to redirect to after the link is accessed
585
+ - language (string, optional): The language for the link. Defaults to HTML element's `lang` attribute
586
+
587
+ - Target-specific parameters:
588
+ For target='consume':
589
+
590
+ - sku (string, required): The SKU of the product to consume
591
+ - episodeId (string, optional): The ID of the episode to consume
592
+
593
+ - For target='change-payment':
594
+
595
+ - contractId (string, required): The ID of the contract to change payment for
579
596
 
580
597
  ### Returns
581
598