Skip to content

Commit f5d14e3

Browse files
committed
* 'develop' of https://github.com/awslabs/aws-lambda-powertools-python: feat: docs anonymized page view (#82)
2 parents 79b1c6e + 05ed3fe commit f5d14e3

File tree

4 files changed

+1612
-0
lines changed

4 files changed

+1612
-0
lines changed

Diff for: docs/gatsby-browser.js

+25
Original file line numberDiff line numberDiff line change
@@ -1 +1,26 @@
11
import "./src/styles/global.css"
2+
import Amplify from 'aws-amplify';
3+
import { Analytics, AWSKinesisFirehoseProvider } from '@aws-amplify/analytics';
4+
import awsconfig from './src/config';
5+
6+
export const onRouteUpdate = ({ location, prevLocation }) => {
7+
Analytics.record({
8+
data: {
9+
url: window.location.href,
10+
section: location.pathname,
11+
previous: prevLocation ? prevLocation.pathname : null
12+
},
13+
streamName: awsconfig.aws_kinesis_firehose_stream_name
14+
}, 'AWSKinesisFirehose')
15+
}
16+
17+
export const onClientEntry = () => {
18+
Analytics.addPluggable(new AWSKinesisFirehoseProvider());
19+
Amplify.configure(awsconfig);
20+
21+
Analytics.configure({
22+
AWSKinesisFirehose: {
23+
region: awsconfig.aws_project_region
24+
}
25+
});
26+
}

0 commit comments

Comments
 (0)