Documentation

Getting started

First call

Ensure the user session and upload a file through Ingest.

1 min read

With the bundle loaded, the first call ensures the user session and uploads a file through Ingest.

Complete page

The uploaded file must be .json.gz (gzip-compressed JSON Lines).

html
<script src="https://cdn.infinity6.ai/releases/sdkweb/latest/bundle/i6sdk-web.js"></script>
<input type="file" id="arquivo" accept=".gz" />
<script type="module">
  async function main() {
    const sdk = new window.I6Sdk();
    // No session: redirects to login
    const user = await sdk.auth().requireUser();
    if (!user) return;

    const input = document.querySelector("#arquivo");
    input.addEventListener("change", async () => {
      const file = input.files[0];
      if (!file) return;
      await sdk.ingest().upload({
        dataset: "<your-dataset>",
        table: "<your-table>",
        partitions: { "<your-key>": "<your-value>" },
        file,
      });
    });
  }
  main();
</script>

How the flow works

  1. The session is ensured when the page loads, so the redirect to login does not discard a file that has already been chosen.
  2. The upload only proceeds if a file is selected.
  3. The upload asks the platform for a signed upload address, using the session, and sends the file directly to that address.

Upload parameters

dataset, table and partitions are placeholders. Use the values from your environment. file is a File object taken from the file input.

Full reference: ingest().

Next step

Understand authentication

Cookie session set by the platform.

See authentication

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.