Skip to content

Instantly share code, notes, and snippets.

@gregavola
Created January 15, 2021 18:07
Show Gist options
  • Save gregavola/730ae3a93c4e8c48d317eaf7781e4619 to your computer and use it in GitHub Desktop.
Save gregavola/730ae3a93c4e8c48d317eaf7781e4619 to your computer and use it in GitHub Desktop.
A way to dynamic share content via Screensnaps IO: http://screensnaps.io/use-cases/dynamic-share-content
const axois = require('axois')
// Payload to send, make sure you include any CSS or Font Library at the time
const data = {
html: "ENTER YOUR MARKUP HERE",
}
const config = {
headers: {
Authorization: 'USER_ID_HERE',
},
};
return axios
.post(`https://api.screensnaps.io/v1/screenshot?api_key=${API_KEY_HERE}`, data, config)
.then((response) => {
// your image is here
console.log(response.data.image_url);
}).catch((err) => {
alert(err.message);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment