Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
@sp-api-sdk/auth
Advanced tools
@sp-api-sdk/auth
Package for simplifying authentication with Selling Partner API
yarn add @sp-api-sdk/auth
npm install @sp-api-sdk/auth
Property Name | Environnement variable -------|--------------|----- clientId | LWA_CLIENT_ID clientSecret | LWA_CLIENT_SECRET accessKeyId | AWS_ACCESS_KEY_ID secretAccessKey | AWS_SECRET_ACCESS_KEY role.arn | AWS_ROLE_ARN role.sessionName | AWS_ROLE_SESSION_NAME
import {SellingPartnerApiAuth} from '@sp-api-sdk/auth'
const auth = new SellingPartnerApiAuth({
clientId: '',
clientSecret: '',
refreshToken: 'Atzr|...',
accessKeyId: '',
secretAccessKey: '',
role: {
arn: roleArn,
sessionName: 'SellingPartnerAPI' // Optional
},
})
const accessToken = await auth.accessToken.get()
const { AccessKeyId, SecretAccessKey, SessionToken } = await auth.getCredentials()
import {SellingPartnerApiAuth, AuthorizationScope} from '@sp-api-sdk/auth'
import {AuthorizationApiClient} from '@sp-api-sdk/authorization-api-v1'
const auth = new SellingPartnerApiAuth({
clientId: '',
clientSecret: '',
scopes: Object.values(AuthorizationScope), // Or choose the only ones you need
accessKeyId: '',
secretAccessKey: '',
region: '',
role: {
arn: '',
}
})
const accessToken = await auth.accessToken.get()
const { AccessKeyId, SecretAccessKey, SessionToken } = await auth.getCredentials()
With an AWS user :
import {SellingPartnerApiAuth} from '@sp-api-sdk/auth'
const auth = new SellingPartnerApiAuth({
clientId: '',
clientSecret: '',
refreshToken: 'Atzr|...',
accessKeyId: '',
secretAccessKey: ''
})
const accessToken = await auth.accessToken.get()
const { AccessKeyId, SecretAccessKey } = await auth.getCredentials()
Everytime you get the access token, the class will check before if the token has already been fetched or if it's still valid, if not, it will fetch it.
Same for the given credentials from Security Token Service
FAQs
Amazon Selling Partner API authentication package
The npm package @sp-api-sdk/auth receives a total of 399 weekly downloads. As such, @sp-api-sdk/auth popularity was classified as not popular.
We found that @sp-api-sdk/auth demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.