Documentation

Getting started

auth()

Reference for user() and requireUser().

1 min read

Service obtained with sdk.auth().

user()

js
await sdk.auth().user()

No parameters.

Returns: a Promise with the JSON returned by api/auth/me (the user profile when there is an active session).

Error conditions

  • The promise rejects, for example, when the request does not complete (network or CORS) or when the response is not valid JSON.

Minimal example

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

requireUser()

js
await sdk.auth().requireUser()

No parameters.

Returns: a Promise with the result of user(). When that result is empty (for example null), it starts the redirect to login and returns null.

Error conditions

  • The same as user().

Minimal example

html
<script type="module">
  async function main() {
    const sdk = new window.I6Sdk();
    const user = await sdk.auth().requireUser();
    if (!user) return;
  }
  main();
</script>

Notes

  • requireUser() uses user() internally.
  • The login URL is described in Login flow.

Next

ingest()

File upload.

See ingest()

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.