polotno-node 1.1.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -37,6 +37,33 @@ run();
37
37
 
38
38
  ## API
39
39
 
40
+ ### `createInstance(options)`
41
+
42
+ Create working instance of Polotno Node.
43
+
44
+ ```js
45
+ const { createInstance } = require('polotno-node');
46
+ const instance = await createInstance({
47
+ // this is a demo key just for that project
48
+ // (!) please don't use it in your projects
49
+ // to create your own API key please go here: https://polotno.dev/cabinet
50
+ key: 'nFA5H9elEytDyPyvKL7T',
51
+ // useParallelPages - use parallel pages to speed up rendering
52
+ // you can use false only for sequential calls
53
+ // it may break rendering if you call many parallel requests
54
+ // default is true
55
+ useParallelPages: false,
56
+ // url - url of the Polotno Client Editor
57
+ // client editor is just simple public html page that have `store` as global variable
58
+ // by default it will run local build
59
+ url: 'https://yourappdomain.com/client',
60
+ // browser - puppeteer browser instance
61
+ // by default it will use chrome-aws-lambda
62
+ // useful to set your own rendering props or use browserless
63
+ browser: browser,
64
+ });
65
+ ```
66
+
40
67
  ### `instance.jsonToDataURL(json, attrs)`
41
68
 
42
69
  Export json into data URL.