Documentation

Getting started

Checking the session

Read the current user from the session with the web SDK.

1 min read

The SDK offers two ways to look at the session.

Querying the user

html
<script type="module">
  const sdk = new window.I6Sdk();
  const user = await sdk.auth().user();
  console.log(user);
</script>

sdk.auth().user() queries api/auth/me on the platform.

Requiring the session

html
<script type="module">
  async function main() {
    const sdk = new window.I6Sdk();
    const user = await sdk.auth().requireUser();
    if (!user) return;
    // from here on there is an active session
  }
  main();
</script>

requireUser() sends the browser to login when there is no active session. Use this form when the page loads, before any user action.

Full reference: auth().

Next step

Cookies and CORS

Requirements for the session to work across origins.

Continue

Support

Implementation support

Official channels for questions during integration.

Response within 1 business day

Technical support email

Response within 1 business day

Send implementation questions with the context of your current step.

Send email
Coming soon

WhatsApp

Response according to the support queue

Direct assistance for quick integration questions.

Available

Support assistant

Immediate response

i6 documentation and implementation assistant.