Button Click
For Single-Page Applications (React, Angular, Vue, Svelte, etc).
Initialize the SDK in your application entry point (typically App.tsx
):
import LuciaSDK from 'lucia-sdk';
LuciaSDK.init({
debugURL: process.env.LUCIA_BASE_URL,
apiKey: process.env.LUCIA_API_KEY,
});
For Vite + TypeScript projects, see our TypeScript Integration Guide
Example
import LuciaSDK from 'lucia-sdk';
LuciaSDK.buttonClick('add_to_cart');
For Multi-Page Application
<script src="https://cdn.luciaprotocol.com/lucia-sdk-latest.min.js"></script>
<script>
LuciaSDK.init({
// API Key from https://ads.clickinsights.xyz
api_key: 'bb10bb08-a7298818-3265d018-e9a648ae-95371b44-d25e6c77-38069b79-1e4bd263',
});
LuciaSDK.buttonClick('BUTTON-NAME');
</script>
Example
<script src="https://cdn.luciaprotocol.com/lucia-sdk-latest.min.js"></script>
<script>
LuciaSDK.init({
// API Key from https://ads.clickinsights.xyz
api_key: 'bb10bb08-a7298818-3265d018-e9a648ae-95371b44-d25e6c77-38069b79-1e4bd263',
});
LuciaSDK.buttonClick('add_to_cart');
</script>