@xxinstall/sdk
v2.0.2
Published
XXinstall attribution SDK — browser
Maintainers
Readme
@xxinstall/sdk
XXinstall attribution SDK — browser (landing page & WebClip/WAP).
Install
CDN
<script src="https://cdn.jsdelivr.net/npm/@xxinstall/[email protected]/dist/xxinstall.global.js"></script>npm
npm install @xxinstall/sdkUsage
Browser (Landing Page)
<script src="https://cdn.jsdelivr.net/npm/@xxinstall/[email protected]/dist/xxinstall.global.js"></script>
<script>
XXinstall.setHost('https://api.xxinstall.org');
XXinstall.store({
appKey: 'YOUR_APP_KEY',
appSecret: 'YOUR_APP_SECRET',
inviteCode: 'ABC123',
channel: 'wechat',
onSuccess(result) { console.log(result); },
});
</script>Browser (WebClip / WAP)
XXinstall.setHost('https://api.xxinstall.org');
XXinstall.resolve({
appKey: 'YOUR_APP_KEY',
appSecret: 'YOUR_APP_SECRET',
onResult(data) { console.log(data); },
});React Native (Expo)
For React Native / Expo apps, use @xxinstall/native instead:
npm install @xxinstall/nativeimport { XXinstall } from '@xxinstall/native';
XXinstall.setHost('https://api.xxinstall.org');
const result = await XXinstall.init({
appKey: 'YOUR_APP_KEY',
appSecret: 'YOUR_APP_SECRET',
});License
MIT
