Skip to main content
Documentation menu

Your first Slidev integration

Connect a Slidev deck to your Inalia talk and display a live poll.

Use the Getting to know the room talk and poll from Your first interactive talk. By the end, an audience response will update the poll in your slides.

Before you start

  • Have an existing Slidev project and access to its files.
  • Use Slidev 0.49.29 or newer, as declared by the add-on's current compatibility requirement.
  • Have an eligible, verified Inalia account. For API-token setup, you also need access to Tokens.
  • Use a trusted local presentation environment with internet access.

Security warning for API-token setup: the add-on uses VITE_INALIA_API_KEY in browser-side requests. Treat anyone who can access the served deck or its JavaScript as potentially able to obtain the token. A gitignored .env prevents committing that file, but does not hide the token in served or built JavaScript. Do not publicly host a live-configured deck. Use a dedicated, least-privilege token and delete it after use. For sharing afterward, follow Publish slides with saved results.

Connect with browser sign-in

With an OAuth-capable addon version and Inalia server, use Node.js 22.12 or newer and run the setup in your deck directory. The inalia package provides the CLI and installs the separate slidev-addon-inalia package:

npx inalia slidev setup

Setup reuses your sign-in or opens your browser to sign in, then lets you choose a talk. It installs the add-on, updates slides.md, and saves the connection in .env. There is no authentication-method prompt.

For an already-installed deck, connect or switch talks with:

npx inalia talk select

To sign in separately, run npx inalia auth login. Signing in alone does not configure a deck; talk select saves the talk number for you. OAuth is the default when no API key is configured, so no authentication-mode variable is needed. The add-on discovers your username automatically; no username setting is needed.

Restart Slidev and open its localhost URL on the same machine. Read permission retrieves your talks, questions and live results; Present permission also starts talks. Use auth login --read-only to request only read access.

Credentials stay in a private user-config file outside your presentation. The local Slidev server refreshes access and authorizes private WebSocket channels without giving OAuth tokens to the browser. Run npx inalia auth logout when you no longer need the connection.

This connection is not available to LAN viewers, static/hosted decks or preview servers. Exported PDFs are static snapshots without a login session. Use static data or finished-talk snapshots for published presentations. Existing API-token configurations remain supported, but keys exposed through VITE_INALIA_API_KEY must never be included in a published deck.

If you used slidev setup, continue with Add the poll to your slides. The manual token configuration below remains available for existing API-token integrations.

1. Create a dedicated token (API-token setup)

Open Tokens, enter a descriptive name such as Practice Slidev deck, and create a token with read permission.

Read is enough to retrieve your talk and questions when you run the talk from the app. Only add write if you need integration controls that run a talk or change demo mode.

Copy the token when it is shown and store it securely. Do not paste it into slides, screenshots, issues, or source control.

2. Install and configure

In your Slidev project's directory:

pnpm add slidev-addon-inalia

Add the add-on to the existing frontmatter at the top of slides.md. Keep any other add-ons and settings:

---
addons:
  - slidev-addon-inalia
---

Merge these entries into the project's .env, replacing the placeholders:

VITE_INALIA_API_KEY=YOUR_DEDICATED_TOKEN
VITE_INALIA_TALK_NUMBER=YOUR_TALK_NUMBER

Use the talk's number within your account, not the title or an internal database ID. Your workspace URL contains the talk number. The add-on automatically retrieves your username from the API token.

Ensure .env is excluded by your project's .gitignore. Restart Slidev using your project's usual development command after changing environment settings.

Optional setup CLI

Instead of the manual setup, use the inalia CLI:

npx inalia slidev setup

Run it inside the Slidev project containing slides.md. It connects your account, lets you choose a talk, installs the package, and updates frontmatter. The bare command shows help rather than starting setup.

The CLI merges its settings into .env, preserving unrelated entries and comments. Review the resulting files and keep .env gitignored. If dependency installation fails, install the package manually.

Choose or switch a talk interactively

To avoid looking up a talk number, run this inside your Slidev project with Node.js 22.12 or newer:

npx inalia talk select

The command reuses your OAuth session or starts browser sign-in when needed. An existing VITE_INALIA_API_KEY in the shell or project's .env takes precedence (shell values win); the CLI never prompts for a token and does not read ~/.inaliarc.

Choose from all talks belonging to that account, listed by title and talk number, newest number first. The command saves the selected VITE_INALIA_TALK_NUMBER in .env; no authentication-mode variable is written. Your username is discovered automatically at runtime. OAuth credentials stay outside the deck; an existing API-token connection saves its configured token. Other entries and comments are preserved. Restart Slidev afterward.

Cancelling, a failed request, or an empty talk list does not change .env. Browser sign-in may still have created a local OAuth session. If no talks exist, create one in Inalia and run the command again. If listing fails, check your sign-in, permissions, and verified account access. Self-hosted OAuth servers must provide GET /api/slidev/me and GET /api/slidev/{username}/talks; update the server if these endpoints are missing.

This command only configures the connection; it does not install the add-on, edit slides.md, or run a talk. Complete the installation and frontmatter steps above first, or use the setup CLI. Keep .env gitignored and follow the token security warning above.

3. Add the poll to your slides

In Inalia's talk question list, open your poll's output menu and choose Slidev. Copy the generated HTML into a slide in slides.md.

For an unfinished talk, it looks like this:

<Inalia questionId="1" />

Use your generated snippet, not the example number. The question number is scoped to the configured talk.

If you finished the tutorial talk, choose Run again before copying live output. Finishing changes newly generated output to static snapshots.

You should see the poll's wording and chart in Slidev. If the component is unknown, check the install and deck frontmatter, then restart Slidev.

4. Receive an answer

  1. Choose Run in the Inalia talk workspace.
  2. Confirm demo mode is off if you want to save this answer.
  3. Open the question's Audience short link on another device, or scan the QR code shown with the live question.
  4. Submit a choice while the poll slide is visible.

The chart should update. You can also confirm the saved answer in Inalia's question workspace. A working static chart alone does not confirm your live connection.

If it does not update, see Troubleshooting and the connection settings.

5. Add opening and feedback slides

Add these as separate slides:

---
layout: inalia-overview
---

---
layout: inalia-feedback
---

The overview helps attendees join. Enable Feedback in Inalia and keep the talk running through feedback collection; the closing slide does not override the talk's status.

Next steps