
Product
Introducing Rust Support in Socket
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
amazon-ads-sdk-ayas
Advanced tools
A comprehensive TypeScript/JavaScript SDK for Amazon Advertising API with full type support
TypeScript/JavaScript SDK for Amazon Advertising API.
npm install amazon-ads-sdk-ayas
or
yarn add amazon-ads-sdk-ayas
import { AmazonAdsSDK } from 'amazon-ads-sdk-ayas';
const sdk = new AmazonAdsSDK({
clientId: 'your-client-id',
clientSecret: 'your-client-secret',
refreshToken: 'your-refresh-token',
region: 'EU',
sandbox: false,
});
// Sponsored Products API
const campaigns = await sdk.sponsoredProducts.campaigns.list();
const adGroups = await sdk.sponsoredProducts.adGroups.list();
// Targeting API
const targeting = await sdk.targeting.targeting.list();
const negativeTargeting = await sdk.targeting.negativeTargeting.list();
You can define the following variables in your .env
file:
AMAZON_CLIENT_ID=your-client-id
AMAZON_CLIENT_SECRET=your-client-secret
AMAZON_REFRESH_TOKEN=your-refresh-token
AMAZON_REGION=EU
SANDBOX_MODE=false
# Install dependencies
npm install
# Build for development
npm run build
# Run tests
npm test
# Run linting
npm run lint
The SDK uses a consistent error handling approach:
try {
const campaigns = await sdk.sponsoredProducts.campaigns.list();
} catch (error) {
if (error.response) {
// Amazon API error
console.error('API Error:', error.response.data);
} else {
// Network or other error
console.error('Error:', error.message);
}
}
The SDK supports authentication through environment variables or direct configuration:
// Using environment variables
const sdk = new AmazonAdsSDK();
// Direct configuration
const sdk = new AmazonAdsSDK({
clientId: 'your-client-id',
clientSecret: 'your-client-secret',
refreshToken: 'your-refresh-token',
region: 'EU',
sandbox: false,
});
git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)This project is licensed under the MIT License - see the LICENSE file for details.
For support, please open an issue in the GitHub repository or contact the maintainers directly.
FAQs
A comprehensive TypeScript/JavaScript SDK for Amazon Advertising API with full type support
The npm package amazon-ads-sdk-ayas receives a total of 1 weekly downloads. As such, amazon-ads-sdk-ayas popularity was classified as not popular.
We found that amazon-ads-sdk-ayas 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.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.