
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@snaptrade/js-fetch-api
Advanced tools
Contact us to schedule a demo and get a consumer key: api@snaptrade.com
npm i @snaptrade/js-fetch-api
Note : Your consumerKey should always remain a secret! Never hard code it!
const SnapTrade = require("@snaptrade/js-fetch-api");
const const snapTrade = new SnapTrade(
"CLIENT_ID",
"CONSUMER_KEY"
);
Register user with SnapTrade in order to create secure brokerage authorizations.
registerUser(data: {
userId: string;
rsaPublicKey?: string;
}): Promise<RegisterUserResponseType>
const registerUser = async () => {
const registeredUser = await snapTrade.registerUser({
userId: 'USER_ID',
rsaPublicKey: 'ssh-rsa RSA_PUBLIC_KEY', //only required if RSA is enabled for the partner
});
return registeredUser;
};
Generate a redirect URI to securely login a user to the SnapTrade Connection Portal.
broker slug to redirect user directly to the broker portal (or show the auth modal)true, user gets redirected back to the partner's app immediately after making a connection.redirect url than the default one.authorization id of a broken connection to reconnect.generateRedirectURI({
userId,
userSecret,
}: DefaultQueryParams, data: {broker: string; immediateRedirect: boolean; customRedirect: string, reconnect: string}): Promise<RedirectURIResponseType>
const redirectURI = async () => {
const uri = await snapTrade.generateRedirectURI(
{
userId: 'USER_ID',
userSecret: 'USER_SECRET',
},
{
broker: 'ALPACA',
immediateRedirect: true,
customRedirect: 'https://passiv.com',
reconnect: 'b5f262d-4bb9-365d-888a-202bd3b15fa1',
}
);
return uri;
};
Delete user from SnapTrade, disabling all brokerage authorizations and permanently deleting all data associated with the user.
deleteUser({
userId,
userSecret,
}: DefaultQueryParams): Promise<DeleteUserResponseType>
const deleteUser = async () => {
const deletedUser = await snapTrade.deleteUser({
userId: 'USER_ID',
userSecret: 'USER_SECRET',
});
return deletedUser;
};
Documentations for making requests to other SnapTrade API endpoints using this sdk:
Licensed under Apache License 2.0.
FAQs
A NodeJS sdk for SnapTrade API.
We found that @snaptrade/js-fetch-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.