Skip to content

Commit

Permalink
Made substreams-api-token optional
Browse files Browse the repository at this point in the history
  • Loading branch information
chamorin committed Jun 29, 2023
1 parent 06f01fb commit c53a59f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "substreams-sink",
"version": "0.5.2",
"version": "0.5.3",
"description": "Substreams Sink",
"type": "module",
"exports": "./dist/index.js",
Expand Down
4 changes: 2 additions & 2 deletions src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function run(substreamPackage: Package, options: RunOptions) {
// Auth
const substreamsApiTokenEnvvar = options.substreamsApiTokenEnvvar ?? DEFAULT_SUBSTREAMS_API_TOKEN_ENV;
const substreamsApiToken = options.substreamsApiToken ?? process ? process.env[substreamsApiTokenEnvvar] : '';
if (!substreamsApiToken) throw new Error('[substreams-api-token] is required');
// if (!substreamsApiToken) throw new Error('[substreams-api-token] is required');

// Read cursor file
const cursorFile = options.cursorFile ?? DEFAULT_CURSOR_FILE;
Expand All @@ -55,7 +55,7 @@ export function run(substreamPackage: Package, options: RunOptions) {

// Connect Transport
const registry = createRegistry(substreamPackage);
const transport = createDefaultTransport(substreamsEndpoint, substreamsApiToken, registry);
const transport = createDefaultTransport(substreamsEndpoint, substreamsApiToken as string, registry);
const request = createRequest({
substreamPackage,
outputModule: moduleName!,
Expand Down

0 comments on commit c53a59f

Please sign in to comment.