Docs menu
createPost
Open the post creator.
Usage
gnr.createPost({
onPostPublish: function (err, data) { console.log(err, data); },
hide_post_types: ["meme"], // hide some post types
mode: window.GNR.modes.SIMPLE, // SIMPLE: create + library; DETAILED adds the brand screen
customAssets: [{ url: "https://example.com/photo.jpg" }],
brandDetails: {
name: "Your Brand Name",
brand_hashtags: "#yourbrand",
brand_website: "https://yourwebsite.com",
brand_handle: "@yourbrand",
brand_colors: ["#2b6cb0", "#f7fafc", "#1a202c"],
},
});💡 Tip
Call createPost inside on("ready").
Parameters
| Name | Description | Type | Required |
|---|---|---|---|
onPostPublish | Receives the post when the user presses Publish. See onPostPublish. | Function | No |
hide_post_types | Post types to hide: image, carousel, video, meme, quote. Default: none hidden. | Array | No |
mode | GNR.modes.SIMPLE shows the create and library screens; GNR.modes.DETAILED (default) also shows the brand screen. | String | No |
customAssets | Pictures (as { url }) your user can put in image and meme posts. Public https links to JPG, PNG or WebP. | Array | No |
brandDetails.name | Fills in the brand name the first time a user sets up their brand. | String | No |
brandDetails.brand_hashtags | Hashtags added to every caption. | String | No |
brandDetails.brand_website | The brand's website. | String | No |
brandDetails.brand_handle | The brand's social handle. | String | No |
brandDetails.brand_colors | Up to 5 colours, as #rrggbb. | Array | No |