@smiileteam/smiile-publish

1.0.2 • Public • Published

Smiile Publish

Official Smiile library to publish content from an external website (yours ;-) to Smiile.

Getting Started

With CDN

<!-- Use standard HTML tag to let you customize appearance of your button. -->
<button id="smiileShare_1">My publication button</button>
<script src="https://unpkg.com/@smiileteam/smiile-publish/dist/smiile-publish.min.js"></script>
<script>
    const publisher = new SmiilePublish();
    document.getElementById('smiileShare_1').addEventListener('click', () => publisher.publish({
        description: "Your content to upload", // The text content and url to upload on your Smiile network
        medias: [] // Url array of images to share with your post
    }));
</script>

With npm

npm i @smiileteam/smiile-publish
import {SmiilePublish} from '@smiileteam/smiile-publish';
const publisher = new SmiilePublish();
document.getElementById('smiileShare_1').addEventListener('click', () => publisher.publish({
    description: "Your content to upload", // The text content and url to upload on your Smiile network
    medias: [] // Url array of images to share with your post
}));

Custom implementation

Our mecanism is really simple. It is just a POST call to Smiile API that will return to you the url to open in a new window. You can see our readable implementation of this in the non minified source code.

For tests and while developing, please use our demo environnement

const publisher = new SmiilePublish({apiDomain: 'demo-api.smiile.com'});

Build and tests

npm install
npm run build
npm run test

Package Sidebar

Install

npm i @smiileteam/smiile-publish

Weekly Downloads

2

Version

1.0.2

License

MIT

Unpacked Size

16.2 kB

Total Files

12

Last publish

Collaborators

  • smiile