add native and web sdks
This commit is contained in:
11
apps/test/src/analytics.ts
Normal file
11
apps/test/src/analytics.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { MixanWeb } from '@mixan-test/sdk-web';
|
||||
|
||||
export const mixan = new MixanWeb({
|
||||
verbose: true,
|
||||
url: process.env.NEXT_PUBLIC_MIXAN_URL!,
|
||||
clientId: process.env.NEXT_PUBLIC_MIXAN_CLIENT_ID!,
|
||||
clientSecret: process.env.NEXT_PUBLIC_MIXAN_CLIENT_SECRET!,
|
||||
trackIp: true,
|
||||
});
|
||||
|
||||
mixan.trackOutgoingLinks();
|
||||
15
apps/test/src/pages/_app.tsx
Normal file
15
apps/test/src/pages/_app.tsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import { useEffect } from 'react';
|
||||
import { mixan } from '@/analytics';
|
||||
import type { AppProps } from 'next/app';
|
||||
import { useRouter } from 'next/router';
|
||||
|
||||
export default function MyApp({ Component, pageProps }: AppProps) {
|
||||
const router = useRouter();
|
||||
useEffect(() => {
|
||||
mixan.init();
|
||||
return router.events.on('routeChangeComplete', () => {
|
||||
mixan.screenView();
|
||||
});
|
||||
}, []);
|
||||
return <Component {...pageProps} />;
|
||||
}
|
||||
14
apps/test/src/pages/index.tsx
Normal file
14
apps/test/src/pages/index.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import Link from 'next/link';
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<div className="flex flex-col gap-2">
|
||||
<Link href="/test">Test</Link>
|
||||
<a href="https://google.se">Google</a>
|
||||
<a href="https://kiddokitchen.se">KiddoKitchen</a>
|
||||
<a href="https://kiddokitchen.se" target="_blank" rel="noreferrer">
|
||||
KiddoKitchen (_blank)
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
9
apps/test/src/pages/test.tsx
Normal file
9
apps/test/src/pages/test.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import Link from 'next/link';
|
||||
|
||||
export default function Test() {
|
||||
return (
|
||||
<div>
|
||||
<Link href="/">Home</Link>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user