diff --git a/.changeset/ready-swans-occur.md b/.changeset/ready-swans-occur.md new file mode 100644 index 000000000..c7c5a8dc5 --- /dev/null +++ b/.changeset/ready-swans-occur.md @@ -0,0 +1,5 @@ +--- +"ms-teams-connect-example": patch +--- + +Add `NEXT_PUBLIC_KNOCK_BRANCH` env var for specifying branch diff --git a/.changeset/some-bats-lick.md b/.changeset/some-bats-lick.md new file mode 100644 index 000000000..79ba6629b --- /dev/null +++ b/.changeset/some-bats-lick.md @@ -0,0 +1,12 @@ +--- +"@knocklabs/react-core": patch +"@knocklabs/react": patch +--- + +Enable use of TeamsKit with branches + +The `useMsTeamsAuth` hook exported by `@knocklabs/react-core` has been updated +so that it works with branches. You can now use either this hook or the +`` component exported by `@knocklabs/react` to test +connecting Microsoft Teams organizations to Knock tenants while working on a +branch. diff --git a/examples/ms-teams-connect-example/.env.sample b/examples/ms-teams-connect-example/.env.sample index 67fceae59..5453045ac 100644 --- a/examples/ms-teams-connect-example/.env.sample +++ b/examples/ms-teams-connect-example/.env.sample @@ -16,3 +16,5 @@ NEXT_PUBLIC_GRAPH_API_CLIENT_ID= # the MS Teams channel you want to use and you'll find its ID on the page NEXT_PUBLIC_KNOCK_MS_TEAMS_CHANNEL_ID= NEXT_PUBLIC_REDIRECT_URL=http://localhost:3000/ + +NEXT_PUBLIC_KNOCK_BRANCH= diff --git a/examples/ms-teams-connect-example/pages/index.tsx b/examples/ms-teams-connect-example/pages/index.tsx index 8b265140b..778a4b882 100644 --- a/examples/ms-teams-connect-example/pages/index.tsx +++ b/examples/ms-teams-connect-example/pages/index.tsx @@ -49,6 +49,7 @@ export default function Home() { user={{ id: user.id }} host={process.env.NEXT_PUBLIC_KNOCK_API_URL} userToken={localStorage.getItem("knock-user-token")!} + branch={process.env.NEXT_PUBLIC_KNOCK_BRANCH} > ({ apiKey: "test_api_key", userToken: "test_user_token", host: "https://example.com", + branch: TEST_BRANCH_SLUG, }), })); @@ -75,6 +78,7 @@ describe("useMsTeamsAuth", () => { channel_id: "test_channel_id", public_key: "test_api_key", user_token: "test_user_token", + branch_slug: TEST_BRANCH_SLUG, }); });