
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Welcome to the Stark Sign Node SDK! This tool is made for Node developers who want to easily integrate with our API. This SDK version is compatible with the Stark Sign API v2.
This library supports the following Node versions:
Feel free to take a look at our API docs.
This project adheres to the following versioning pattern:
Given a version number MAJOR.MINOR.PATCH, increment:
1.1 To install the package with npm, run:
npm install starksign
You must configure the SDK to use one of our two available environments:
sandbox: This is a testing environment where you can get to know and test your system's interactions with ours.production: This is real World, where your actions will have a real impact on your operations.To do this, assign it while your application is booting:
const starksign = require('starksign')
starksign.environment = "sandbox" // or production
On all following examples, we will assume a default user has been set.
The error language (and timeout) can also be set in the same way as the default user:
const starksign = require('starksign')
starksign.language = "en-US"
Language options are "en-US" for English and "pt-BR" for Brazilian Portuguese. English is the default.
There are 3 ways a party can sign a document:
Using this method, the signer will receive a link (by email, SMS, etc.), which will open the document link with a validated signature button. By reading the document and clicking on the button, the person's signature will be registered. This method doesn't require usage of this SDK and its functions.
Using this method, you are expected to provide an interface (via browser, app, etc.) to the signer, who will read the document, receive a token (via email, SMS, etc.) and then inform it to the interface to sign it.
Using this method, your service will receive a request on the informed endpoint. This request will carry a private key, which should be used to sign the document after its validation.
If you need a server/system to automatically sign the documents, you can follow these steps:
If your system is expected to sign documents that are being generated, be prepared to receive calls to the informed endpoint and parse them accordingly before you proceed with the signature:
const starksign = require('starksign');
const express = require('express')
const app = express()
app.use(express.raw({type: "*/*"}));
const port = 3000
app.post('/', async (req, res) => {
try {
let signatureRequest = await starksign.signatureRequest.parse({
content: req.body.toString(),
signature: req.headers['digital-signature']
});
console.log(signatureRequest)
res.end()
}
catch (err) {
console.log(err)
res.status(400).end()
}
})
app.listen(port, () => console.log(`Example app listening at http://localhost:${port}`))
Once you receive a signature request, fetch the referenced document to check it out before signing it:
const starksign = require('starksign');
(async() => {
let document = await starksign.document.get(signatureRequest.documentId)
console.log(document)
})();
Once you have the SignatureRequest and Document and your system understands the signature is due, you can sign it:
const starksign = require('starksign');
(async() => {
let signature = await starksign.document.sign({
id: document.id,
content: document.content,
signerId: signatureRequest.signerId,
privateKey: signatureRequest.privateKey,
})
console.log(signature)
})();
If you expect your users to sign documents using the tokens they receive via email, SMS, etc., your interface (which should already have the document data loaded) should be able to receive their tokens and sign on their behalf by doing this:
This is the same method used before, but the token is provided instead of the privateKey:
const starksign = require('starksign');
// since your interface is asking for a specific document's signature, it should already know the document and signer
(async() => {
const document = await getDocument() //this is not an SDK function, you should implement this to get the Document data
const signer = await getSigner() // this is not an SDK function, you should implement this to get the Signer data
const token = await getUserInput() // this is not an SDK function, you should implement this to get the user input
const signature = await starksign.document.sign({
id: document.id,
content: document.content,
signerIslad: signer.id,
token: token,
})
console.log(signature)
})();
The SDK may raise one of four types of errors: InputErrors, InternalServerError, UnknownError, InvalidSignatureError
InputErrors will be raised whenever the API detects an error in your request (status code 400). If you catch such an error, you can get its elements to verify each of the individual errors that were detected in your request by the API. For example:
const starksign = require('starksign');
(async() => {
try{
let signature = await starksign.document.sign({
id: "7a8361ec097543daa48acd5312471cf5",
content: "<meta charset='utf-8'><page size='A4'>Test</page>",
signerId: "2345234523452345",
token: "abcd1234",
});
} catch (e) {
if (e instanceof InputErrors) {
for (error of e.errors) {
console.log(error.code, error.message);
}
} else {
throw e;
}
}
})();
InternalServerError will be raised if the API runs into an internal error. If you ever stumble upon this one, rest assured that the development team is already rushing in to fix the mistake and get you back up to speed.
UnknownError will be raised if a request encounters an error that is neither InputErrors nor an InternalServerError, such as connectivity problems.
InvalidSignatureError will be raised specifically by starksign.event.parse() when the provided content and signature do not check out with the Stark Sign public key.
If you have any questions about our SDK, just send us an email. We will respond you quickly, pinky promise. We are here to help you integrate with us ASAP. We also love feedback, so don't be shy about sharing your thoughts with us.
Email: help@starkbank.com
FAQs
SDK to facilitate Node integrations with Stark Sign
We found that starksign demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.