mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 10:14:03 +00:00
wip
This commit is contained in:
parent
e3d7e5bcc7
commit
0e4cb88bb5
5 changed files with 27 additions and 23 deletions
|
|
@ -1,25 +1,16 @@
|
|||
import splitbee from '@splitbee/web';
|
||||
|
||||
(function (tag) {
|
||||
if (! tag) {
|
||||
return;
|
||||
}
|
||||
splitbee.init({
|
||||
scriptUrl: "https://tenancyforlaravel.com/bee.js",
|
||||
apiUrl: "https://tenancyforlaravel.com/_hive",
|
||||
})
|
||||
|
||||
let data = tag.dataset;
|
||||
if (! data.token) {
|
||||
return;
|
||||
}
|
||||
window.auth = function (username) {
|
||||
if (! username) return window.location.replace('https://github.com/tenancy-for-laravel/saas-boilerplate');
|
||||
|
||||
splitbee.init({
|
||||
scriptUrl: "https://tenancyforlaravel.com/bee.js",
|
||||
apiUrl: "https://tenancyforlaravel.com/_hive",
|
||||
token: data.token,
|
||||
})
|
||||
|
||||
splitbee.enableCookie();
|
||||
splitbee.user.set({github: data.github});
|
||||
splitbee.track('Purchase', {
|
||||
product: data.product,
|
||||
price: data.price,
|
||||
splitbee.user.set({
|
||||
userId: username.substr(1),
|
||||
}).finally(() => {
|
||||
window.location.replace('https://github.com/tenancy-for-laravel/saas-boilerplate');
|
||||
});
|
||||
})(document.getElementById('extsb'));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue