Skip to content

Conversation

@yusinto
Copy link
Contributor

@yusinto yusinto commented Jun 27, 2024

No description provided.

@yusinto yusinto requested a review from a team June 27, 2024 05:16
@yusinto yusinto marked this pull request as draft June 27, 2024 05:17
},
"dependencies": {
"@launchdarkly/node-server-sdk": "workspace:^",
"launchdarkly-js-client-sdk": "^3.4.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Callout: Use the classic js sdk for now.

"stripInternal": true,
"target": "ES2017",
"types": ["jest", "node"]
"types": ["jest", "node", "react/canary"],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Callout: Need react/canary to be able to use react cache. Nextjs does this so I'm not feeling too bad about it.

@yusinto yusinto marked this pull request as ready for review June 27, 2024 21:44
const context = { kind: 'user', key: 'test-user-2' };
(ldc as JSSdk).identify(context).then(() => {
console.log('identify successful, persisting to cookies');
setCookie('ld', context);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setCookie automatically stringifies the cookie value.

## Usage

1. Enable [instrumentationHook](https://nextjs.org/docs/app/building-your-application/optimizing/instrumentation) in `next.config.mjs`:
1. On server start, initialize the Node Server SDK. If you are using NextJS App Router, do this in `instrumentation.ts`. You'll need to enable the [instrumentationHook](https://nextjs.org/docs/app/building-your-application/optimizing/instrumentation):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This universal sdk should work with all framework which supports rsc (gatsby, remix, etc).

@yusinto yusinto requested a review from kinyoklion June 27, 2024 23:23
@yusinto yusinto enabled auto-merge (squash) June 28, 2024 00:25
@yusinto yusinto requested a review from kinyoklion July 2, 2024 16:48
@yusinto yusinto merged commit e1d2d30 into main Jul 2, 2024
@yusinto yusinto deleted the yus/sc-248499/move-ld-nextjs-to-js-core branch July 2, 2024 18:20
@github-actions github-actions bot mentioned this pull request Jul 2, 2024
yusinto added a commit that referenced this pull request Jul 2, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>react-native-client-sdk: 10.2.0</summary>

##
[10.2.0](react-native-client-sdk-v10.1.5...react-native-client-sdk-v10.2.0)
(2024-07-02)


### Features

* Added react-universal code.
([#493](#493))
([e1d2d30](e1d2d30))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yusinto Ngadiman <yusinto@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants