Skip to content

Commit

Permalink
docs on sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
squallstar committed Apr 28, 2017
1 parent 650ef9f commit 239029d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
29 changes: 29 additions & 0 deletions docs/Fliplet-SDK.md
@@ -0,0 +1,29 @@
# Fliplet SDK

The Fliplet SDK enables you to use all the JS APIs outside of our environment. This means you can use them on any client-side code which is not sitting on Fliplet's domains.

---

## How to use the SDK?

Simply include a script tag to our JS SDK with your auth token (although it's not strictly required to use the JS APIs).

```html
<script type="text/javascript" src="http://api.fliplet.dev/sdk.js?auth_token=123"></script>

<script type="text/javascript">
Fliplet().then(function () {
Fliplet.Apps.get().then(console.log)
});
</script>
```

## Include other dependencies

Other dependencies can be included by providing a comma-separated list of the package names via the `packages` query parameter.

e.g. `packages?lodash,fliplet-datasources,fliplet-media`

```html
<script type="text/javascript" src="http://api.fliplet.dev/sdk.js?packages=fliplet-media&auth_token=123"></script>
```
1 change: 1 addition & 0 deletions docs/README.md
Expand Up @@ -23,3 +23,4 @@ To get a brief introduction to the technologies we use and the stack of the plat
- [Dependencies and assets](Dependencies-and-assets.md)
- [Sending events between components](Event-emitter.md)
- [Best practises and advices](Best-practises.md)
- [Using the JS APIs externally](Fliplet-SDK.md)

0 comments on commit 239029d

Please sign in to comment.