Prerequisites
- A working Web quickstart
- A Web-compatible effect package and its resources
Add the package
For a Vite project, place the package in public/filters:
public/filters/heart_face.nosmai
It will be served at /filters/heart_face.nosmai.
Apply it
const result = await sdk.applyEffect(
'/filters/heart_face.nosmai',
);
if (!result.success) {
throw new Error(result.error ?? 'Effect could not be applied');
}
The package must be compatible with the Web preview. Mobile package support does not guarantee Web support.
Verify it worked
Reload with browser cache disabled once, then confirm the network request is 200 and the effect is visible.
Common errors
| Symptom | Fix |
|---|---|
Package request is 404 | Confirm the public path and deployment output |
| CORS or CSP blocks the request | Allow the package origin in hosting and Content Security Policy |
| Package loads but is rejected | Use Web compatibility inspection and a package authored for the preview |