Basics
Initialization

Initialization of bard-ai

Make sure you read through the Authentication page first, if you haven't already.

After obtaining your key, you are going to have to initialize it, so that bard-ai knows it. You key remains local on your device, so no one else can see it.

Example

import Bard from "bard-ai";
 
await Bard.init(COOKIE_KEY);

Parameters

ParameterTypeDescription
keystringThe COOKIE_KEY you are initializing with. Required.

Usage

Simply call the asynchronous function Bard.init(), with your cookie key, exactly as it is shown in the example above. It is recommended to store the key in a secure location, and then access it in your file indirectly. This will limit accidently committing or sending your key to GitHub or other platforms.