@cesdk/node-native 1.77.0-nightly.20260610

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.
Files changed (47) hide show
  1. package/LICENSE.md +137 -0
  2. package/README.md +474 -0
  3. package/ThirdPartyLicenses.md +1041 -0
  4. package/assets/ly.img.cesdk/fonts/imgly_font_inter_semibold.otf +0 -0
  5. package/assets/ly.img.cesdk/icons/ErrorAudio.svg +5 -0
  6. package/assets/ly.img.cesdk/icons/ErrorConnection.svg +5 -0
  7. package/assets/ly.img.cesdk/icons/ErrorImage.svg +6 -0
  8. package/assets/ly.img.cesdk/icons/ErrorUnknown.svg +3 -0
  9. package/assets/ly.img.cesdk/icons/ErrorVideo.svg +6 -0
  10. package/assets/ly.img.cesdk/icons/Move.svg +3 -0
  11. package/assets/ly.img.cesdk/icons/RotateIndicator.svg +5 -0
  12. package/assets/ly.img.cesdk/icu/icudt74l.dat +0 -0
  13. package/assets/ly.img.cesdk/presets/.keep +0 -0
  14. package/assets/ly.img.cesdk/shaders/adjustments.sksl +106 -0
  15. package/assets/ly.img.cesdk/shaders/black_and_white_color_mixer.sksl +152 -0
  16. package/assets/ly.img.cesdk/shaders/common/ubq_adjustments.sksl +102 -0
  17. package/assets/ly.img.cesdk/shaders/common/ubq_color_conversions.sksl +354 -0
  18. package/assets/ly.img.cesdk/shaders/common/ubq_constants.sksl +13 -0
  19. package/assets/ly.img.cesdk/shaders/common/ubq_hue_constants.sksl +86 -0
  20. package/assets/ly.img.cesdk/shaders/common/ubq_noise.sksl +82 -0
  21. package/assets/ly.img.cesdk/shaders/cross_cut.sksl +38 -0
  22. package/assets/ly.img.cesdk/shaders/dot_pattern.sksl +29 -0
  23. package/assets/ly.img.cesdk/shaders/duotone_filter.sksl +26 -0
  24. package/assets/ly.img.cesdk/shaders/extrude_blur.sksl +85 -0
  25. package/assets/ly.img.cesdk/shaders/glow.sksl +31 -0
  26. package/assets/ly.img.cesdk/shaders/half_tone.sksl +14 -0
  27. package/assets/ly.img.cesdk/shaders/linocut.sksl +30 -0
  28. package/assets/ly.img.cesdk/shaders/liquid.sksl +19 -0
  29. package/assets/ly.img.cesdk/shaders/lut_filter.sksl +70 -0
  30. package/assets/ly.img.cesdk/shaders/mask_color.sksl +16 -0
  31. package/assets/ly.img.cesdk/shaders/mirror.sksl +21 -0
  32. package/assets/ly.img.cesdk/shaders/outliner.sksl +40 -0
  33. package/assets/ly.img.cesdk/shaders/pixelize.sksl +10 -0
  34. package/assets/ly.img.cesdk/shaders/placeholder_overlay_lines.sksl +18 -0
  35. package/assets/ly.img.cesdk/shaders/posterize.sksl +8 -0
  36. package/assets/ly.img.cesdk/shaders/radial_pixel.sksl +22 -0
  37. package/assets/ly.img.cesdk/shaders/recolor.sksl +57 -0
  38. package/assets/ly.img.cesdk/shaders/sharpie.sksl +74 -0
  39. package/assets/ly.img.cesdk/shaders/shifter.sksl +22 -0
  40. package/assets/ly.img.cesdk/shaders/tiltshift.sksl +21 -0
  41. package/assets/ly.img.cesdk/shaders/tv_glitch.sksl +25 -0
  42. package/assets/ly.img.cesdk/shaders/vignette.sksl +12 -0
  43. package/example.js +31 -0
  44. package/lib/index.d.ts +4072 -0
  45. package/lib/index.js +4922 -0
  46. package/lib/index.js.map +7 -0
  47. package/package.json +59 -0
package/LICENSE.md ADDED
@@ -0,0 +1,137 @@
1
+ # Creative Editor Software Development Kit (SDK)
2
+
3
+ ## Terms of Service
4
+
5
+ ### 1. Subject Matter
6
+
7
+ 1.1 These Terms of Service (together with any applicable Order Form the "**Agreement**") govern all rights granted by Licensor to use and commercially exploit any of the IMG.LY SDKs (the "**Software**"), namely the CreativeEditor SDK and/or PhotoEditor SDK and/or VideoEditor SDK and/or imglyKit SDK.
8
+
9
+ 1.2 The Agreement is entered into by and between IMG.LY GmbH, Kortumstraße 19-21, 44787 Bochum, Germany (the "**Licensor**") and the entity identified in the Order Form (the "**Licensee**", together with Licensor the "**Parties**") as of the effective date the Order Form is last signed on.
10
+
11
+ 1.3 This Agreement shall govern the use of the Software for commercial purposes. To the extent the Software is intended to be used for non-commercial purposes only, an alternative licensing scheme may be available upon Licensor's discretion.
12
+
13
+ ### 2. Order Form
14
+
15
+ 2.1 An "**Order Form**" may either be executed (i) by the Parties upon individual negotiation or (ii) via an online order issued by Licensee via Licensor's website at img.ly (the "**Website**") that has been confirmed by Licensor. Online orders not confirmed within 14 days after issuance shall be considered denied.
16
+
17
+ 2.2 No rights shall be granted to Licensee by virtue of these Terms of Service alone as such grant requires the execution of an Order Form making reference to these Terms of Service.
18
+
19
+ 2.3 The Order Form shall specify the environment for the Software that shall be licensed by Licensee. The Software is currently available for integration in the following environments, but is not limited to: (i) Web, (ii) iOS, (iii) Android, and (iv) Node.js.
20
+
21
+ 2.4 The Order Form shall specify (i) the Subscription Term and (ii) the License Fees. Unless specified otherwise in the Order Form, the Subscription Term shall be based on monthly or annual periods for payment of the License Fees (the "**Payment Periods**").
22
+
23
+ 2.5 Licensor may choose to offer Licensee a trial period specified by Licensor to test the Software in a dedicated testing environment not subject to License Fees (the "**Trial Period**"). Licensor may also choose to offer Licensee extended trial periods subject to License Fees (“Extended Trial Period”). These Trial Periods and/or Extended Trial Periods will automatically end upon completion and do not require termination. Licensee acknowledges that converting from a Trial Period and/or Extended Trial Period to a regular Subscription Term may require additional steps, as outlined in the Order Form. Upon expiration of the Trial Period and/or Extended Trial Period, the right to test the Software shall cease without further notice. Licensee shall then be required to execute an Order Form to obtain a License for a Subscription Term in case the Software shall be further used.
24
+
25
+ 2.6 The Order Form can include usage-based pricing models based on factors such as monthly active users or number of exports. The pricing can also be based on Licensee’s company size. Licensee shall not make any false statements in regard to the eligibility thresholds stated on the Order Form or relevant for pricing. Further Licensee is solely responsible to keep Licensor informed about any changes on its part with respect to the eligibility thresholds or aspects relevant for pricing stated on the Order Form. 
26
+
27
+ 2.7 Licensee shall inform Licensor of any "**agency relationship”, if necessary under a Non-Disclosure Agreement, under which Licensee effectively shall not be the entity making use of the Software but intends to source the Software for use by a third party. In such case, Licensor shall be free to execute an Agreement with the entity effectively making use of the Software as Licensee only.  
28
+
29
+ ### 3. Grant of Rights
30
+
31
+ 3.1 Licensor shall grant to Licensee a worldwide, non-exclusive, non-transferable, non-sublicensable right to use the Software subject to the terms of this Agreement, in particular with the specifications as set out in the Order Form (the "**License**").
32
+
33
+ 3.2 The License shall pertain to the Software in object code format as well as to content data (fonts, stickers, stock images, etc.) included therein. In order to enable integration of the Software, parts of the Software may be provided in source code format if agreed upon in the Order Form individually or if offered by Licensor in its free discretion; in such case, the License shall also pertain to the Software in source code format.
34
+
35
+ 3.3 The License shall be limited to the right (i) to copy and – in case of disclosure in source code format – modify the Software solely for integration into one of Licensee's products (website or app) (the "**Licensee’s Product**") in accordance with the requirements of interfaces and implementation guidelines as issued by Licensor (the "**Integrated Software**") and (ii) to copy, distribute and make available the Integrated Software to Licensee's end customers in object code format (the License does not cover distribution, making available or disclosure of the Software or any part thereof in source code format).
36
+
37
+ ### 4. Obligations and Restrictions
38
+
39
+ 4.1 Licensee shall not reproduce, disassemble, or reverse assemble any portion of the Software or otherwise derive its source code, except to the extent that such activity is specifically permitted by this Agreement or by statutory law.
40
+
41
+ 4.2 Licensee shall not redistribute the Software or its modifications other than by integrating the Software into Licensee's Product. Use in context of more than one of Licensee's Products shall require multiple Licenses accordingly via respective Order Forms. Licensee's Product shall have a substantially different functionality than the Software (i.e. must not be described as a photo editor and/or video editor, respective development kit, library, or product commercially competing with the Software); otherwise, Licensor shall be entitled to terminate the Agreement and revoke the License at any time.
42
+
43
+ 4.3 Licensee shall not use the Software in connection with or to promote any products, services, or materials that constitute or promote spyware, adware, or other malicious programs or code, unsolicited mass distribution of email (spam), defamatory, pornographic, abusive or otherwise offensive content; otherwise, Licensor shall be entitled to terminate the Agreement and revoke the License at any time.
44
+
45
+ 4.4 Licensor shall be entitled to verify and validate Licensee's use of the Software in line with this Agreement via respective functionalities of the Software. In particular, Licensor is entitled to make access to the Software dependent from successful remote validation (via API) of a license key allocated to an active Subscription Term and covering the intended access and use.
46
+
47
+ 4.5 Licensor shall be entitled to use server-side monitoring tools to analyze use of the Software by users. Licensee shall safeguard that such monitoring by Licensor can be performed in accordance with applicable privacy and data protection law via respective notices and, if required, opt-in procedures. Licensor will support Licensee to the extent required by providing required information and instruction. 
48
+
49
+ ### 5. Proprietary Rights
50
+
51
+ 5.1 All rights not expressly granted to Licensee are reserved by Licensor. Licensee acknowledges and agrees that all rights to modifications of the source code made by Licensee to enable integration of the Software shall belong to the Licensor as part of the Software; the Licensee shall assign all respective rights to Licensor or, in case no assignment is feasible under applicable law, Licensee shall grant a worldwide, exclusive, transferable, sublicensable right to use such modifications without any restrictions. Licensee shall have no rights to use, copy, or reproduce the Software except as expressly set forth in this Agreement.
52
+
53
+ 5.2 No rights shall be granted with regard to trademarks, trade names, trade dress and trade secrets to Licensee except for the limited right of use provided under the License.
54
+
55
+ ### 6. Third Party Components
56
+
57
+ 6.1 The Software implements components licensed under open source licenses ("OSS Components**") and further software components and content data (fonts, stickers, stock images, etc.) provided by third parties under applicable licensing terms ("Third Party Components**"). The use of the OSS Components and the Third Party Components is subject to the applicable separate licensing terms. A list of the OSS Components and Third Party Components with reference to the applicable licensing terms is accessible online via https://img.ly/acknowledgements. Licensor does not act as sublicensor or agent in this regard and assumes or acknowledges no warranty or liability for the OSS Components and the Third Party Components.
58
+
59
+ 6.2 Licensee shall only use further third party software components or content data (fonts, stickers, stock images, etc.) with the Software to the extent that Licensee is entitled to such use. Licensor shall not be liable or responsible for any use of third party software components or content data by Licensee. Licensee shall indemnify and hold harmless Licensor from any third-party claims caused by Licensee's actions involving third party software components or content data.
60
+
61
+ ### 7. Payment
62
+
63
+ 7.1 The license fees as specified in the Order Form (the "**License Fees**") shall be due and payable in line with the Payment Periods. To the extent the due date is not specified in the Order Form, the License Fees shall be due upon the execution of the Order Form and then upon the commencement of each further Payment Period for all of the Subscription Term.
64
+
65
+ 7.2 Licensor shall invoice the License Fees to Licensee. Invoices are payable without deduction within 14 days of the date of the invoice and may be made by direct payment on the Website via credit card, if a respective option is provided by Licensor. If Licensee is in default of payment, the outstanding amount shall bear interest as applicable under statutory law. Licensor reserves all further rights resulting from default.
66
+
67
+ 7.3 Unless specified otherwise in the Order Form, the License Fees shall be paid in Euros. All amounts stated in the Order Form are excluding any applicable value added tax (VAT), unless explicitly specified otherwise. Licensee shall be responsible for any applicable sales, use, value added or similar taxes payable with respect to the licensing of the Software, or arising out of or in connection with this Agreement, other than taxes levied or imposed based upon Licensor's income or gross revenues. If Licensee has tax-exempt status, Licensee shall provide written evidence of such status to Licensor. Upon Licensor's request, Licensee shall provide its VAT identification number or other identification information required for invoicing purposes.
68
+
69
+ 7.4 The license fees specified in the Order Form (the "**License Fees**") are subject to price adjustments in accordance with changes in the Consumer Price Index ("CPI**") published by the European Central Bank (https://www.ecb.europa.eu/). Corresponding License Fee adjustments are made at renewal for annual Subscription Terms and after every 12 months for other Subscription Terms. 
70
+
71
+ ### 8. Delivery and Maintenance
72
+
73
+ 8.1 The Software shall be delivered via download from designated package repositories. The designated link for such download shall be provided in the Order Form. The use of the Software in a Subscription Term requires a key that shall be provided upon the initial payment of the License Fees, subject to the terms agreed upon in the Order Form. The key required for a Trial Period shall be provided upon commencement and deactivated upon expiration of the Trial Period.
74
+
75
+ 8.2 The Software and Documentation shall be provided in English language.
76
+
77
+ 8.3 Licensee shall be responsible for installing the Software and providing the system environment required to operate the Software in accordance with the requirements as set forth in the Documentation.
78
+
79
+ 8.4 Subject to any other specification in the Order Form, Licensor shall not provide any support and maintenance services other than the issuance of such updates, upgrades or patches for the Software as made available via the Website. Licensor shall have no obligation to provide support or maintenance for the Integrated Software or any modifications to the Software made by Licensee for integration into one of Licensee's Products.
80
+
81
+ 8.5 Licensor may choose to offer Licensee a separate Service Level Agreement detailing specific availability commitments against additional remuneration. Such availability commitments always exclude downtime due to planned maintenance and downtime outside Licensor’s control. In case of planned maintenance leading to downtime exceeding three hours, Licensor will notify Licensee via email.
82
+
83
+ ### 9. Term and Termination
84
+
85
+ 9.1 The term of the License shall be determined in the Order Form (the "**Subscription Term**"). The License shall commence upon initial payment of the License Fees and expire upon the end of the Subscription Term(s). Unless stated otherwise in the Order Form, the initial Subscription Term shall automatically be extended by further consecutive Subscription Terms unless either party notifies the other in writing of its intent not to extend the License prior to the end of the current Subscription Term. For monthly Subscription Terms, the notification must be given one week prior to the end of the then-current Subscription Term in order to be valid. For other Subscription Terms, the notification must be given one month prior to the end of the then-current Subscription Term in order to be valid. Upon expiration of the Subscription Term(s), the right to use the Software shall cease without further notice. To the extent the Subscription Term is not specified in the Order Form, Licensor shall be entitled to terminate the Agreement and revoke the License at any time.
86
+
87
+ 9.2 Either Party shall be entitled to immediately terminate this Agreement or suspend any rights granted hereunder upon notice to the other in the event that: (i) the other Party breaches any material term of this Agreement, Licensor may particularly revoke the License in case of default or other non-payment of License Fees or use of the Software in breach of Sections 3.3 or 5.1; or (ii) upon the other Party's dissolution, liquidation, or the appointment of a receiver, trustee, custodian, or similar agent for the Party's business or property. A change of control of Licensee, the sale of all or more than 50% of Licensee's assets, or a merger or reorganization of Licensee in which Licensee is not the surviving organization is considered dissolution of Licensee. In the event that Licensor terminates this Agreement for breach, all amounts due or to become due under this Agreement shall immediately become due and payable.
88
+
89
+ 9.3 Upon expiration of the Subscription Term or termination, each Party shall promptly remit to the other all unpaid monies due, or to become due, under this Agreement. Licensee shall return to Licensor or destroy all copies of the Software in its possession and provide written confirmation to that effect; this particularly applies to the Software in source code format in case such disclosure has occurred. In case of termination or revocation of the License, paid monies or due payments for any commenced Payment Periods shall not be refunded to Licensee.
90
+
91
+ 9.4 In addition to those provisions which by their nature are intended to survive any termination or expiration of this Agreement or any license granted hereunder, Sections 11, 12 and 13 of this Agreement shall specifically survive such expiration or termination.
92
+
93
+ 9.5 In the event of termination or expiration of the Subscription Term, the Licensee is obliged to promptly cease use of and remove the Software from all of its products. Until the Software is confirmed to be completely removed from all of the Licensee's products, Licensor reserves the right to continue to charge the Licensee the agreed License Fees. The Licensee must provide satisfactory evidence of the complete removal of the Software upon request of the Licensor.
94
+
95
+ ### 10. Warranty Claims
96
+
97
+ 10.1 Product descriptions shall not be deemed guaranteed unless separately agreed in writing.
98
+
99
+ 10.2 Rights in case of defects shall be excluded in case of minor or immaterial deviations from the characteristics of the Software or in the case of only slight impairment of use. Licensor shall further not be responsible for defects which are caused by improper use or operation. Licensor shall not be responsible for ensuring that any modifications made by Licensee to the Software for integration into one of Licensee's Products will work other versions of the Software.
100
+
101
+ 10.3 Any claims for damages are subject to the limitations set forth under Section 11 of this Agreement.
102
+
103
+ ### 11. Limitation of Liability
104
+
105
+ 11.1 Licensor shall be liable without restriction for damages caused intentionally or with gross negligence by Licensor, its legal representatives or assistants in performance. Licensor shall also be liable without restriction for death, personal injury or damage to health caused by Licensor, its legal representatives or assistants in performance. Furthermore, Licensor shall be liable without restriction for damages in accordance with the German Product Liability Act.
106
+
107
+ 11.2 Licensor shall be liable for damages caused by breach of its primary obligations under this Agreement by Licensor, its legal representatives or assistants in performance. Primary obligations are such duties that form the essence of the Agreement, which were decisive for the conclusion of the Agreement and on the performance of which Licensee may rely. If Licensor breaches its primary obligations with simple negligence, then its liability shall be limited to the amount which was foreseeable for Licensor at the time when the respective duty was performed. Any further liability of Licensor shall be excluded on the merits. In particular, any liability of Licensor for initial defects of the Software already present at the start of the Subscription Term shall be excluded. 
108
+
109
+ 11.3 The right to set off a claim shall be limited to such claims that are uncontested or have been finally established with legal effect.
110
+
111
+ ### 12. Confidentiality
112
+
113
+ 12.1 Each Party may be granted access to confidential information of the other Party during the term of this Agreement. Confidential information does not include information that: (i) is or becomes publicly available through no act or omission of the other party, (ii) is rightfully acquired by the recipient from a third party that was not under an obligation to hold the information in confidence, (iii) is independently developed by the recipient or, (iv) is previously known to the recipient without non-disclosure obligations. The terms of this Agreement and the source code to the Software shall constitute confidential information under this Agreement.
114
+
115
+ 12.2 Neither Party shall use any confidential information of the other Party other than for the purpose of exercising its rights or performing its obligations under this Agreement or disclose to any third party any confidential information of the other Party except as permitted under this Agreement. Disclosure of confidential information shall not be precluded if such disclosure is in response to a valid order of a court or other governmental body or is otherwise required by statutory law.
116
+
117
+ 12.3 Subject to the exceptions under Section 12.2., Licensee shall not disclose the terms of this Agreement to any third party.
118
+
119
+ 12.4 Non-disclosure agreements executed by the Parties independent from this Agreement shall remain in force.
120
+
121
+ ### 13. Final Provisions
122
+
123
+ 13.1 Licensor shall be entitled to identify Licensee as a customer and to refer to Licensee and its business by name, trademark and trade name, if applicable, on the Website and in Licensor's marketing materials.
124
+
125
+ 13.2 Licensor shall not accept, and this Agreement does not operate as an acceptance of, any different or additional terms and conditions, and this Agreement shall prevail over any such different or additional provisions, of any Licensee's order.
126
+
127
+ 13.3 All notices or reports shall be in writing or sent by email.
128
+
129
+ 13.4 Licensee may not assign this Agreement, in whole or in part to any third party without the prior written consent of Licensor.
130
+
131
+ 13.5 Amendments or additions to this Agreement must be made in writing to be effective. This shall also apply to amendments of this written form requirement.
132
+
133
+ 13.6 This Agreement shall be governed by the laws of the Federal Republic of Germany; the regulations of the UN Sales Convention shall be excluded.
134
+
135
+ 13.7 The courts for Licensor's registered office shall have exclusive jurisdiction over all disputes under and in connection with this Agreement.
136
+
137
+ 13.8 Should any provision of this Agreement be or become invalid, this shall not affect the validity of the remaining terms. In such event, the Parties shall be obliged to cooperate in the creation of terms which achieve such legally valid result as comes closest commercially to that of the invalid provision. The above shall apply accordingly to the closing of any gaps in the Agreement.
package/README.md ADDED
@@ -0,0 +1,474 @@
1
+ ![Hero image showing the configuration abilities of CE.SDK](https://img.ly/static/cesdk_release_header.png)
2
+
3
+ # @cesdk/node-native
4
+
5
+ Native Node.js bindings for the IMG.LY *Creative Engine*, the core of CE.SDK.
6
+ A drop-in alternative to [`@cesdk/node`](https://www.npmjs.com/package/@cesdk/node)
7
+ (WASM) that loads the engine as a platform-native N-API addon. The native
8
+ build adds video and audio export, GPU-accelerated rendering, and removes the
9
+ WASM 4 GB linear-memory ceiling.
10
+
11
+ For full Creative Engine documentation see
12
+ [https://img.ly/docs/cesdk/web/guides/headless/setup_node](https://img.ly/docs/cesdk/web/guides/headless/setup_node).
13
+
14
+ ## When to choose `@cesdk/node-native`
15
+
16
+ Pick `@cesdk/node-native` if you need any of the following; otherwise stay on
17
+ `@cesdk/node` (WASM), which has wider platform coverage:
18
+
19
+ - **Video and audio export** (MP4 / H.264 via VideoToolbox on macOS, GStreamer
20
+ on Linux).
21
+ - **Working memory above ~4 GB.** WASM linear memory is capped; native uses
22
+ the full process address space.
23
+ - **Hardware-accelerated rendering** for image export on Metal (macOS) or EGL
24
+ (Linux). CPU fallback is automatic when no GPU is available.
25
+
26
+ For raw call overhead the native addon also avoids the WASM↔JS boundary, but
27
+ the practical impact is workload-dependent — measure on your own scenes
28
+ before relying on a specific multiplier.
29
+
30
+ ## Supported platforms
31
+
32
+ | OS | Arch | Node | Minimum OS |
33
+ | ----- | ------- | ---- | ------------------------------------------------ |
34
+ | macOS | `arm64` | ≥ 20 | macOS 12 (Monterey) |
35
+ | macOS | `x64` | ≥ 20 | macOS 12 (Monterey) |
36
+ | Linux | `x64` | ≥ 20 | glibc ≥ 2.39 (Ubuntu 24.04, Debian 13, RHEL 10) |
37
+
38
+ **Not supported in this release:**
39
+
40
+ - Windows
41
+ - Linux `arm64`
42
+ - musl-based distributions (Alpine, etc.)
43
+ - AWS Lambda Node.js runtimes (AL2 / AL2023 ship glibc 2.26 / 2.34 — use
44
+ `@cesdk/node` for serverless until a manylinux build lands)
45
+
46
+ `npm install @cesdk/node-native` succeeds on unsupported hosts (the main
47
+ package itself has no platform filter), but the binary-carrying sibling is
48
+ filtered out by npm's `os` / `cpu` / `libc` constraints and the first
49
+ `require('@cesdk/node-native')` throws a clear error pointing at
50
+ `@cesdk/node` (WASM). This is intentional so that conditional installs in
51
+ Dockerfiles and CI don't fail at install time.
52
+
53
+ ## Installation
54
+
55
+ ```bash
56
+ npm install @cesdk/node-native
57
+ # or, to track nightly builds:
58
+ npm install @cesdk/node-native@dev
59
+ ```
60
+
61
+ ## Usage
62
+
63
+ ES Modules:
64
+
65
+ ```js
66
+ import CreativeEngine from '@cesdk/node-native';
67
+
68
+ const engine = await CreativeEngine.init({ license: 'YOUR_LICENSE_KEY' });
69
+ const scene = engine.scene.create();
70
+ const page = engine.block.create('page');
71
+ engine.block.appendChild(scene, page);
72
+ engine.block.setWidth(page, 1920);
73
+ engine.block.setHeight(page, 1080);
74
+
75
+ const png = await engine.block.export(page, 'image/png', {});
76
+ // `png` is a Blob (same as @cesdk/node). Use `png.arrayBuffer()` to read.
77
+ engine.dispose();
78
+ ```
79
+
80
+ CommonJS:
81
+
82
+ ```js
83
+ const CreativeEngine = require('@cesdk/node-native');
84
+
85
+ CreativeEngine.init({ license: 'YOUR_LICENSE_KEY' }).then(async (engine) => {
86
+ // ... same API as above.
87
+ engine.dispose();
88
+ });
89
+ ```
90
+
91
+ > **Always call `engine.dispose()` when done.** The engine runs an internal
92
+ > update timer (driving rendering and export), so until you dispose it the
93
+ > Node.js event loop stays alive and the process will not exit on its own — a
94
+ > short-lived script or a Lambda handler that skips `dispose()` will appear to
95
+ > hang until timeout.
96
+
97
+ ## License & evaluation mode
98
+
99
+ The CreativeEditor SDK is a commercial product. Purchase a license at
100
+ <https://img.ly/pricing>.
101
+
102
+ You can run the engine in **evaluation mode** by passing an empty string as
103
+ the license key. In evaluation mode the engine prints an IMG.LY banner on
104
+ stderr and watermarks output. There are three equivalent ways to enter it:
105
+
106
+ ```js
107
+ // 1. Empty string at init.
108
+ await CreativeEngine.init({ license: '' });
109
+
110
+ // 2. Omit `license` entirely at init, then unlock later.
111
+ const engine = await CreativeEngine.init();
112
+ engine.editor.unlockWithLicense(''); // evaluation
113
+ // engine.editor.unlockWithLicense('YOUR_KEY'); // upgrade in place
114
+
115
+ // 3. Inspect the active key (empty string => evaluation mode).
116
+ engine.editor.getActiveLicense();
117
+ ```
118
+
119
+ ## Linux runtime dependencies
120
+
121
+ The Linux platform package statically links libc++ / libc++abi /
122
+ libstdc++ into the addon, so a stock Ubuntu 24.04 / Debian 13 install
123
+ needs only the engine's runtime dependencies. On `ubuntu:24.04` and
124
+ `debian:13` the relevant packages are present by default; minimal base
125
+ images (slim, distroless) need them installed explicitly.
126
+
127
+ **Image / scene / archive workflows** depend on the standard graphics
128
+ stack:
129
+
130
+ ```bash
131
+ apt-get install -y \
132
+ libcurl4 \
133
+ libssl3 \
134
+ libfontconfig1 \
135
+ libfreetype6 \
136
+ libuuid1 \
137
+ libxcb1 \
138
+ libgl1 \
139
+ libegl1
140
+ ```
141
+
142
+ **Video and audio export** additionally needs GStreamer 1.x plus the
143
+ common plugin sets:
144
+
145
+ ```bash
146
+ apt-get install -y \
147
+ libgstreamer1.0-0 \
148
+ gstreamer1.0-plugins-base \
149
+ gstreamer1.0-plugins-good \
150
+ gstreamer1.0-plugins-bad \
151
+ gstreamer1.0-plugins-ugly \
152
+ gstreamer1.0-libav \
153
+ gstreamer1.0-gl
154
+ ```
155
+
156
+ A future release will offer a self-contained GStreamer bundle shipped
157
+ inside the Linux platform package; until then, system GStreamer is
158
+ required.
159
+
160
+ ### Supported Docker base images
161
+
162
+ The Linux platform package ships with a **glibc ≥ 2.39 floor** (the
163
+ `libc: ["glibc"]` npm filter blocks Alpine/musl at install time;
164
+ older-glibc systems install successfully but fail at first
165
+ `require('@cesdk/node-native')` with `version 'GLIBC_2.XX' not found`).
166
+
167
+ | Base image | Works? | glibc | Notes |
168
+ |---|---|---|---|
169
+ | `ubuntu:24.04` (and `:24.04-slim`) | yes | 2.39 | Reference image |
170
+ | `debian:13` (`trixie`, and `:13-slim`) | yes | 2.41 | |
171
+ | `node:22-trixie` | yes | 2.41 | |
172
+ | `gcr.io/distroless/nodejs22-debian13` | yes | 2.41 | Recommended distroless |
173
+ | `node:22-alpine` | no | musl | Filtered at install |
174
+ | `amazonlinux:2` / `:2023` | no | 2.26 / 2.34 | Below floor; also AWS Lambda base |
175
+ | `public.ecr.aws/lambda/nodejs:22` | no | 2.34 | Below floor; see Lambda note below |
176
+
177
+ Use `@cesdk/node` (WASM) on every "no" row above.
178
+
179
+ ### AWS Lambda
180
+
181
+ The Linux platform package targets glibc 2.39+; AWS Lambda's Amazon Linux
182
+ 2 / 2023 base images ship glibc 2.26 / 2.34, both below the floor. A
183
+ Lambda function that does `require('@cesdk/node-native')` will fail at
184
+ load with `GLIBC_2.38 not found`. **Use `@cesdk/node` (WASM) on Lambda.**
185
+ The `apps/cesdk_web_examples/cookbooks-aws-lambda/` cookbook documents
186
+ the WASM-on-Lambda path.
187
+
188
+ ## Bundlers (webpack / esbuild / Next.js / Vite)
189
+
190
+ `@cesdk/node-native` ships a native `.node` binary that bundlers cannot
191
+ inline. Mark the package external and have the bundler emit the
192
+ `.node` + the `assets/` resource bundle into the output as-is.
193
+
194
+ ### webpack / Next.js (server-side / API routes)
195
+
196
+ ```js
197
+ // next.config.js — server side only, never the browser bundle
198
+ module.exports = {
199
+ webpack(config, { isServer }) {
200
+ if (isServer) {
201
+ config.externals = [
202
+ ...(config.externals ?? []),
203
+ '@cesdk/node-native',
204
+ '@cesdk/node-native-darwin-arm64',
205
+ '@cesdk/node-native-darwin-x64',
206
+ '@cesdk/node-native-linux-x64',
207
+ ];
208
+ }
209
+ return config;
210
+ },
211
+ // Next.js 13+ App Router with server components:
212
+ experimental: {
213
+ serverComponentsExternalPackages: ['@cesdk/node-native'],
214
+ },
215
+ };
216
+ ```
217
+
218
+ ### esbuild
219
+
220
+ ```js
221
+ await esbuild.build({
222
+ // …
223
+ platform: 'node',
224
+ external: [
225
+ '@cesdk/node-native',
226
+ '@cesdk/node-native-darwin-arm64',
227
+ '@cesdk/node-native-darwin-x64',
228
+ '@cesdk/node-native-linux-x64',
229
+ ],
230
+ });
231
+ ```
232
+
233
+ ### Vite (server / SSR)
234
+
235
+ ```js
236
+ export default defineConfig({
237
+ ssr: {
238
+ external: ['@cesdk/node-native'],
239
+ noExternal: [],
240
+ },
241
+ });
242
+ ```
243
+
244
+ In every bundler the engine resource bundle (`@cesdk/node-native/assets/`)
245
+ must reach the runtime layout intact. Either keep `node_modules/` next to
246
+ the bundle output, or copy `node_modules/@cesdk/node-native/assets/`
247
+ into the deploy artifact and point `CreativeEngine.init({ baseURL })` at
248
+ that location explicitly.
249
+
250
+ ## Yarn Plug'n'Play
251
+
252
+ Yarn PnP virtualises the `node_modules` graph through `.pnp.cjs`; the
253
+ default mode keeps optional dependencies inside the zip cache, which
254
+ breaks `dlopen` against the platform sibling package's `.node` because
255
+ the dynamic linker cannot read into a zip filesystem. The fix is to opt
256
+ the platform package out of PnP zipping by declaring it `unplugged`:
257
+
258
+ ```yaml
259
+ # .yarnrc.yml
260
+ nodeLinker: pnp
261
+ pnpEnableInlining: false
262
+ ```
263
+
264
+ ```jsonc
265
+ // package.json
266
+ {
267
+ "dependencies": { "@cesdk/node-native": "^1.77.0-nightly.20260610" },
268
+ "dependenciesMeta": {
269
+ "@cesdk/node-native-darwin-arm64": { "unplugged": true },
270
+ "@cesdk/node-native-darwin-x64": { "unplugged": true },
271
+ "@cesdk/node-native-linux-x64": { "unplugged": true }
272
+ }
273
+ }
274
+ ```
275
+
276
+ The `unplugged` setting causes Yarn to extract the matching platform
277
+ sibling into `.yarn/unplugged/`, where the `.node` resolves to a real
278
+ filesystem path that `dlopen` can consume. The `nodeLinker: node-modules`
279
+ mode (Yarn classic compatibility) doesn't need this — it materialises a
280
+ real `node_modules/` tree on disk and works out of the box.
281
+
282
+ ## Migration from `@cesdk/node`
283
+
284
+ The Block, Scene, Editor, Asset, Event, and Variable APIs are the same. For
285
+ the vast majority of code paths, `@cesdk/node-native` is a drop-in
286
+ replacement: change the import and run.
287
+
288
+ ```diff
289
+ - import CreativeEngine from '@cesdk/node';
290
+ + import CreativeEngine from '@cesdk/node-native';
291
+ ```
292
+
293
+ Binary-returning methods (`block.export`, `block.exportVideo`,
294
+ `block.exportAudio`, `block.saveToArchive`, `scene.saveToArchive`) return
295
+ `Blob` on both packages. `block.export()` accepts both the WASM-shaped
296
+ `(block, { mimeType, ... })` and the positional `(block, mimeType, options)`
297
+ signatures, so existing call sites don't need rewriting.
298
+
299
+ Default asset-source helpers (`engine.asset.addDefaultAssetSources`,
300
+ `engine.asset.addDemoAssetSources`) are available with the same options
301
+ (`baseURL`, `excludeAssetSourceIds`, `sceneMode`).
302
+
303
+ ### Intentional divergence
304
+
305
+ - `engine.update()` is public on `@cesdk/node-native` (the wrapper pumps
306
+ frames internally during exports; you only need it if you're driving
307
+ frame-perfect work manually). On WASM it's private — the browser's
308
+ animation frame drives it.
309
+
310
+ ### Swapping in for tooling that pins `@cesdk/node`
311
+
312
+ For test runs or third-party packages that import `@cesdk/node` by literal
313
+ name (e.g. internal importers/exporters), point your bundler/test runner's
314
+ module alias at `@cesdk/node-native` — its export shape matches `@cesdk/node`,
315
+ so no call sites need to change:
316
+
317
+ ```js
318
+ // e.g. in a vitest/vite config
319
+ resolve: { alias: { '@cesdk/node': '@cesdk/node-native' } }
320
+ ```
321
+
322
+ In application code, prefer importing `@cesdk/node-native` directly.
323
+
324
+ ## Video export
325
+
326
+ `@cesdk/node-native` is the first IMG.LY-distributed Node binding to expose
327
+ video export. The two known foot-guns:
328
+
329
+ 1. **`options.duration` defaults to `0`** for parity with the WASM
330
+ `@cesdk/node` package. The encoder treats `0` as "render a single frame",
331
+ which is rarely the intended outcome. Always pass an explicit duration:
332
+
333
+ ```js
334
+ await engine.block.exportVideo(page, 'video/mp4', onProgress, {
335
+ duration: 3.0,
336
+ framerate: 30,
337
+ });
338
+ ```
339
+
340
+ 2. **Scenes loaded from an archive must wait for AV resources** before
341
+ `exportVideo` can make progress; otherwise the encoder spins on resources
342
+ that haven't been fetched and the progress callback never fires. Pass
343
+ `waitForResources: true` when loading a video scene whose assets aren't
344
+ already in memory, or follow up with `engine.block.forceLoadAVResource`
345
+ (or `forceLoadResources`) on each video-fill block before calling
346
+ `exportVideo`:
347
+
348
+ ```js
349
+ const scene = await engine.scene.loadFromArchiveURL(file_url, {
350
+ waitForResources: true,
351
+ });
352
+ const [page] = engine.block.findByType('page');
353
+ const mp4 = await engine.block.exportVideo(page, 'video/mp4', onProgress, {
354
+ duration: engine.block.getTotalSceneDuration(scene),
355
+ framerate: 30,
356
+ });
357
+ ```
358
+
359
+ The wrapper pumps `update()` internally during `init()`, so unlike
360
+ `@cesdk/node` (WASM), **you do not need to drive a `setInterval` pump
361
+ loop around `exportVideo`**. The export `await`s naturally. Only call
362
+ `engine.update()` directly if you're driving frame-perfect work outside
363
+ of the built-in export path.
364
+
365
+ A runnable end-to-end example is in `examples/video-export-3s.js` of the
366
+ source repository.
367
+
368
+ ## Cross-platform lockfiles (CI pitfalls)
369
+
370
+ `@cesdk/node-native` ships a different `.node` per platform via npm's
371
+ `optionalDependencies` (the same pattern as `esbuild`, `sharp`, etc.). One
372
+ rough edge to call out:
373
+
374
+ > `npm ci` on CI using a lockfile generated on a different architecture
375
+ > succeeds at install but fails with `ERR_DLOPEN_FAILED` at runtime.
376
+
377
+ Recommended mitigations (pick one):
378
+
379
+ 1. **`npm install --include=optional @cesdk/node-native` on CI.** Re-resolves
380
+ optional dependencies for the actual host. Slightly slower than `npm ci`,
381
+ robust.
382
+ 2. **Generate the lockfile on the same OS/arch as CI** (a `node:22` Docker
383
+ image for Linux consumers).
384
+ 3. **Per-platform lockfiles.** Over-engineering for most projects.
385
+
386
+ Docker images that bake `@cesdk/node-native` into a final artifact should
387
+ always install inside the target image, never copy `node_modules/` from a
388
+ different-arch host.
389
+
390
+ ## Advanced: override the binary path
391
+
392
+ For air-gapped builds or custom distributions, set
393
+ `CESDK_NATIVE_BINARY_PATH` to an absolute path to the `.node` binary. The
394
+ loader uses it directly, bypassing `require.resolve`:
395
+
396
+ ```bash
397
+ CESDK_NATIVE_BINARY_PATH=/opt/cesdk/cesdk_native.node node app.js
398
+ ```
399
+
400
+ Set `DEBUG=cesdk:native` (or `CESDK_DEBUG=1`) to log loader resolution steps
401
+ when triaging install issues.
402
+
403
+ ### Skipping the integrity check (cold-start-sensitive deploys)
404
+
405
+ On first `init()` the loader streams a SHA-256 over the ~32 MB `.node` and
406
+ compares it to a checksum sidecar — a corruption/truncation guard (it is **not**
407
+ anti-substitution; that's npm provenance). This adds a few tens of milliseconds
408
+ to each cold start. For latency-sensitive serverless cold paths (e.g. AWS Lambda)
409
+ where the artifact is already integrity-checked by the platform, you can skip it:
410
+
411
+ ```bash
412
+ CESDK_SKIP_BINARY_VERIFY=1 node app.js
413
+ ```
414
+
415
+ Leave verification on by default; only opt out when cold-start latency matters
416
+ and the binary's integrity is guaranteed by other means.
417
+
418
+ ## Known limitations
419
+
420
+ - **IMG.LY banner and engine diagnostics on stderr.** The native engine
421
+ prints a one-time license banner and occasional engine logs (e.g.
422
+ `EventSubscriptionService::initEventCallbacks errorStateChanged`) to
423
+ stderr. Capture or redirect stderr (`node app.js 2>/dev/null`,
424
+ `child_process.spawn(..., { stdio: ['inherit', 'inherit', 'ignore'] })`)
425
+ if it interferes with machine-readable output. A `setLogLevel` API is
426
+ tracked for a future release.
427
+ - **macOS binaries are not code-signed.** Plain `node` doesn't enforce
428
+ signatures on `dlopen`, so the addon loads out of the box for normal
429
+ Node.js usage. Electron apps that notarize the containing app must sign
430
+ the nested `cesdk_native.node` with their own Developer ID in their
431
+ `afterSign` hook before notarization. Hosts that enforce strict library
432
+ validation (some Electron variants, hardened runtime CI runners) will
433
+ reject the unsigned binary; full Developer ID + notarization on our side
434
+ is tracked as a follow-up.
435
+ - **Per-block error inspection.** The engine emits a `errorStateChanged`
436
+ log line when a block transitions to an error state (e.g. a video-fill
437
+ resource fails to load). Read the per-block state via
438
+ `engine.block.getState(blockId)` after `update()` to inspect the failure;
439
+ a top-level error subscriber is tracked as a follow-up.
440
+
441
+ ## Troubleshooting
442
+
443
+ ### `Failed to load the @cesdk/node-native addon for ...`
444
+
445
+ Most commonly, npm skipped `optionalDependencies` during install. Reinstall:
446
+
447
+ ```bash
448
+ npm install --include=optional @cesdk/node-native
449
+ ```
450
+
451
+ For pnpm and Yarn, regenerate the lockfile on the target platform/arch
452
+ (easiest via a Docker build), or use per-platform lockfiles. Neither
453
+ package manager has a direct equivalent of npm's `--include=optional`.
454
+
455
+ ### Linux: `version 'GLIBC_2.XX' not found`
456
+
457
+ This build targets glibc ≥ 2.39 — see "Supported platforms". Stay on
458
+ `@cesdk/node` (WASM) for older systems until a manylinux build lands.
459
+
460
+ ### macOS: `library load disallowed by system policy`
461
+
462
+ The published binary is not code-signed. `npm install` doesn't add the
463
+ `com.apple.quarantine` xattr so this error doesn't show up there, but if
464
+ you obtained the package via a browser download or a sideloaded zip, the
465
+ quarantine flag will block `dlopen`. Strip it with:
466
+
467
+ ```bash
468
+ xattr -d com.apple.quarantine node_modules/@cesdk/node-native-*/cesdk_native.node
469
+ ```
470
+
471
+ ## License
472
+
473
+ The CreativeEditor SDK is a commercial product. Purchase a license at
474
+ <https://img.ly/pricing>.