Skip to content

Support process.env.REPLICATE_API_TOKEN for implicit auth? #121

@zeke

Description

@zeke

To use the client today, you have to do this:

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

What if you could just do:

const replicate = new Replicate()

..and have it default to process.env.REPLICATE_API_TOKEN, if present?

This is similar to how the Python client works, and I kinda like it. Also makes code examples a lot cleaner.

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