Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session replay standalone CDN script initialisation #799

Closed
steverob opened this issue Jul 3, 2024 · 4 comments
Closed

Session replay standalone CDN script initialisation #799

steverob opened this issue Jul 3, 2024 · 4 comments
Labels
question Further information is requested

Comments

@steverob
Copy link

steverob commented Jul 3, 2024

Summary

I'm looking to use the CDN version of the standalone session replay plugin. I am unable to figure out how to initialise it with the API key and start recording.

I'm using rudderstack as my instrumentation framework and it can give me sessionId & deviceId.

I'm only able to call the "plugin" function on the session replay object made available via the CDN script and it does not seem to take api key.

@steverob steverob added the question Further information is requested label Jul 3, 2024
@kwalker3690
Copy link

kwalker3690 commented Jul 3, 2024

@steverob Thanks for calling our attention here, it looks like our docs are missing instructions for the Standalone Session Replay SDK initialization via script tag. I'll make updates to our docs, but in the meantime you can use the following script:

<script src="https://cdn.amplitude.com/libs/session-replay-browser-1.10.0-min.js.gz"></script>
<script>
window.sessionReplay.init(AMPLITUDE_API_KEY, {
    deviceId: "<string>",
    sessionId: "<number>",
    sampleRate: "<number>"
    ...
 })
</script>

And then please follow the rest of the guidance on how to update the session id and grab the event properties in this documentation: https://amplitude.com/docs/session-replay/session-replay-standalone-sdk

@steverob
Copy link
Author

steverob commented Jul 4, 2024

@kwalker3690 thanks for your response. But it seems like init is not available on the sessionReplay object.

screen-grab-2024-07-04T19 54 19

screen-grab-2024-07-04T19 55 53

@kwalker3690
Copy link

@steverob please check the comment above and confirm you have the matching script tag, it looks to me like you're still using the plugin script tag. You need to use the standalone script tag (it should not have the word 'plugin' in it)

@steverob
Copy link
Author

steverob commented Jul 5, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants