Skip to content

Commit 3727835

Browse files
docs: add get rendering status section to projects api doc.
1 parent 06013d5 commit 3727835

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

docs/PROJECTS_API.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- [Apply Template Preset on the Project](#apply-template-preset-on-the-project)
1111
- [Duplicate the Project](#duplicate-the-project)
1212
- [Render the Project](#render-the-project)
13+
- [Get rendering status](#get-rendering-status)
1314

1415
### Get All Projects
1516

@@ -195,4 +196,30 @@ Renderforest.renderProject(4120385, { quality: 360, watermark: 'https://example.
195196

196197
[See example](https://github.com/renderforest/renderforest-sdk-node/blob/master/samples/projects/render-project.js)
197198

199+
200+
### Get rendering status
201+
202+
Our rendering status method uses user's defined `callback` to manage rendering status percentage
203+
and uses error first callback pattern. If you want to unsubscribe from getting rendering status then simply call
204+
`unsubscribe` (`getRenderingStatus` method returns function to unsubscribe from getting rendering status).
205+
206+
```js
207+
const RenderforestClient = require('@renderforest/sdk-node')
208+
209+
const Renderforest = new RenderforestClient({ signKey: '<signKey>', clientId: -1 })
210+
211+
Renderforest.renderProject(15431416, { quality: 720 })
212+
.then(() => {
213+
const unsubscribe = Renderforest.getRenderingStatus((error, percentage) => {
214+
if (error) {
215+
console.log(error)
216+
}
217+
// take percentage from here
218+
console.log(percentage)
219+
// if you want in unsubscribe in some case, then simply call unsubscribe
220+
unsubscribe()
221+
})
222+
})
223+
```
224+
198225
**[⬆ back to the top](#projects-api)**

0 commit comments

Comments
 (0)