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

[Feature]: Support SSR frameworks as an ES6 module #147

Open
bscaspar opened this issue Nov 14, 2023 · 1 comment
Open

[Feature]: Support SSR frameworks as an ES6 module #147

bscaspar opened this issue Nov 14, 2023 · 1 comment

Comments

@bscaspar
Copy link

What problem are you facing?

I would like to import the Braze web-sdk as an ES6 module. The current client-side only implementation requires workarounds to work with SSR frameworks, as documented in #103, #110, and #117.

Using these workarounds just to import Braze increases code complexity and increases maintenance time and effort.

SSR frameworks are some of the most popular web frameworks. Please support them!

Workarounds

Documented in #103, #110, and #117.

Ideal Solution

import { initialize, openSession, changeUser, [...etc] } from '@braze/web-sdk';

...
initialize(key);
openSession();
chaangeUser(userId);

Other Information

No response

@davidbielik
Copy link
Collaborator

Hi @bscaspar thanks for raising this - definitely great feedback and something we'll consider for a future major version. Right now the SDK is tightly coupled with browser APIs but we're exploring ways to make the SDK work in a server environment like SSR. We don't have a timeline we can share, but will keep this updated once we make any notable progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants