Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Commit

Permalink
feat: expound on using next tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
justinemmanuelmercado authored and moltar committed Jun 28, 2020
1 parent 7b305c7 commit 74e24ab
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion examples/using-next-tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,31 @@ const main = async () => {
* Using received NextTokens
*/

const newNextToken = marketplaceParticipationsList.NextToken?.token
const newNextToken = marketplaceParticipationsList.NextToken
if (newNextToken) {
const [
newMarketplaceParticipationsList,
newRequestMeta,
] = await sellers.listMarketplaceParticipationsByNextToken(newNextToken)
}

/**
* If you have next tokens from outside the SDK you can instantiate your own
*/

const myNextTokenFromOutsideTheApplication = new NextToken(
/**
* Action needs to match the original action instead of the "...ByNextToken" action
* i.e. use `ListMarketplaceParticipations` as your action instead of `ListMarketplaceParticipationsByNextToken`
*/
'ListMarketplaceParticipations', // Action
'MYNEXTTOKEN123', // Next token value
)

const [
myMarketPlaceParticipationsList,
myRequestMeta,
] = await sellers.listMarketplaceParticipationsByNextToken(myNextTokenFromOutsideTheApplication)

/**
* Check out Amazon's official docs for other available endpoints
Expand Down

0 comments on commit 74e24ab

Please sign in to comment.