UNPKG

@trivia-api/fetch

Version:

Functions to fetch data from The Trivia API.

17 lines (16 loc) 567 B
import { V2Question, Session } from "@trivia-api/client"; export interface CreateSessionParams { categories?: string[]; tags?: string[]; difficulty?: V2Question["difficulty"]; region?: string; } /** * Creates a session, allowing a user to request random questions without * receiving duplicates * * @param apiKey - API key with access to sessions * @param host - Optional parameter to send to a different API host * @returns the created session object */ export declare const createSession: (apiKey: string, host?: string) => Promise<Session>;