Skip to content

throw an error if the API token is undefined #76

@zeke

Description

@zeke

I was doing this:

import Replicate from "replicate";

const replicate = new Replicate({
  auth: process.env.REPLICATE_API_TOKEN,
});

But REPLICATE_API_TOKEN wasn't actually set in the env. So I was getting "Not found" errors. We should check for this and blow up with an error ahead of time, before making the request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions