Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@copicake/copicake-js
Advanced tools
🍰 Copicake, a data-driven image generating service to let you generate any social media material with just ONE CLICK.
Because we host our library on GitHub, so you need to change your settings to use our library.
Change your .npmrc
file to :
# .npmrc
# normal npm registry
registry=https://registry.npmjs.org
# install copicake from GitHub registry
@copicake:registry=https://npm.pkg.github.com
And then install copicake:
npm install --save @copicake/copicake-js
Add the following settings into your .yarnrc
file:
# normal npm registry
registry "https://registry.npmjs.org"
# install copicake from GitHub registry
"@copicake:registry" "https://npm.pkg.github.com"
And then install copicake:
yarn add @copicake/copicake-js --dev
You need to initialize to get copicake instance first :
import Copicake from "@copicake/copicake-js";
const copicake = new Copicake({
apiKey: "your-api-key",
});
copicake.image
.create({
template_id: "YOU_TEMPLATE_ID",
changes: [
{ name: "text-9so09m", text: "hello world", color: "#ff0000" },
{ name: "image-yeavh7", src: "https://your_website.com/test.png" },
],
options: {
webhook_url: "https://your_website.com/webhook_url",
},
})
.then((response) => {
// You will get a rendering response with processing state.
// https://docs.copicake.com/#/api/v1/image/create?id=response
console.log(response);
})
.catch((error) => {
// For more details, please check https://docs.copicake.com/#/errors
console.error(error);
});
const renderingId = `YOUR_RENDERING_ID`;
copicake.image
.get(renderingId)
.then((response) => {
// For more details, please check https://docs.copicake.com/#/api/rendering
console.log(response);
})
.catch((error) => {
// For more details, please check https://docs.copicake.com/#/errors
console.error(error);
});
Sometimes you may notice that your image is still under processing
state, this is because the image is still being processed in the background by our servers.
In this way, we provide another handy method called getUntilFinished()
to get the image until the image is ready.
Internally, this is just a wrapper of get()
method with built-in retry mechanism. If after MAX_RETRY_TIMES and the image is still under processing
state, we will throw an error (500) to let you know.
const renderingId = `YOUR_RENDERING_ID`;
copicake.image
.getUntilFinished(renderingId)
.then((response) => {
// For more details, please check https://docs.copicake.com/#/api/rendering
if (response.status === "success") {
// do something
} else if (response.status === "failed") {
// do something
}
})
.catch((error) => {
// For more details, please check https://docs.copicake.com/#/errors
console.error(error);
});
FAQs
Copicake JS Library
The npm package @copicake/copicake-js receives a total of 8 weekly downloads. As such, @copicake/copicake-js popularity was classified as not popular.
We found that @copicake/copicake-js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.