Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
classy-node
Advanced tools
Built for the creativity and flexibility of the world's most innovative minds, create impactful apps and integrations that make social enterprises more efficient and effective. Engineer the world for good with the Classy API.
Request access and learn more by visiting developers.classy.org.
View Full Documentation with Available Methods
npm install classy-node
Start by instantiating your classy
instance. We recommend storing your client ID and client secret as environment variables.
var Classy = require('classy-node');
var classy = new Classy({
clientId: process.env.CLIENT_ID,
clientSecret: process.env.CLIENT_SECRET
});
Then, use classy.app()
to obtain an application token and make calls as a trusted Classy application:
classy.app().then(function() {
// Make calls on behalf of the application
});
Every resource method returns a promise:
classy.campaigns.retrieve(19, {
token: 'app'
}).then(function(response) {
// Do something with the response
}).catch(function(error) {
// Do something with the error
});
Each resource can contain several basic methods (retrieve, update, delete). Each resource might also include additional custom methods that act upon related resources or perform specialized operations:
create()
retrieve()
update()
del()
create{RelatedResource}()
e.g., createCampaign()
list{RelatedResources}()
e.g. listCampaigns()
retrieve{RelatedResource}(parentId, resourceId)
e.g. campaigns.retrieveDesignation()
publish()
, unpublish()
, & deactivate()
cp .env.example .env
and fill in the necessary env varsbabel-node example/filename.js
We've added the ability to specify an errorLogger when instantiating Classy Node so that more specific information surrounding errors can be passed back to the clients and used.
This is different from requestDebug in that it will expose data related to errors on requests as well as from Classy Node in addition to other various information (where the error occured, params passed in to the failing method, etc.).
NOTE:
Error data returned has the potential to contain sensitive data. We attempt to provide the data in a non-JSONified manner whenever possible to aid with the omitting or filtering of sensitive information based on object keys (commonly access_key, secret_key, etc.) if you're using a third party or non-secure means for storing error logs.
let bugsnag = null;
let errorLogger = (error, other) => {
console.log('An error occured', error, other);
};
if (process.env.BUGSNAG_API_KEY) {
bugsnag = Bugsnag({
apiKey: process.env.BUGSNAG_API_KEY
});
errorLogger = (error, other) => bugsnag.notify(error, { metaData: other });
}
const classy = new Classy({
clientId: process.env.CLIENT_ID,
clientSecret: process.env.CLIENT_SECRET,
baseUrl: process.env.BASE_URL,
requestDebug: true,
errorLogger: errorLogger
});
When submitting a pull request, please make sure you've written good commit messages that include references to issues and clearly describe what the commit achieves. Use the commit body to explain what you did and why you did it. Thanks!
You can run our tests with npm test
and get coverage reports with npm run coverage
.
You can run the example with babel-node example/index.js
. Make sure you have your environment variables for CLIENT_ID
and CLIENT_SECRET
set up!
Classy Node was built by the developers at Classy in San Diego, CA. We're on a mission to mobilize and empower the world for good.
The code was heavily inspired by Stripe's awesome stripe-node.
FAQs
Classy API wrapper
The npm package classy-node receives a total of 50 weekly downloads. As such, classy-node popularity was classified as not popular.
We found that classy-node demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.