config#IS_PROD TypeScript Examples

The following examples show how to use config#IS_PROD. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: sessionStore.ts    From lightning-terminal with MIT License 5 votes vote down vote up
/**
   * Adds a new session
   * @param label the user defined label for this session
   * @param type the type of session being created (admin, read-only, etc)
   * @param expiry how long the session should be valid for
   * @param mailboxServerAddr the address where the mailbox server is reachable
   * @param devServer whether the mailbox server is a dev server that has no valid TLS cert
   */
  async addSession(
    label: string,
    type: LIT.SessionTypeMap[keyof LIT.SessionTypeMap],
    expiry: Date,
  ) {
    try {
      this._store.log.info(`submitting session with label ${label}`, {
        expiry,
        proxyServer: this.proxyServer,
        devServer: !IS_PROD,
      });

      const { session } = await this._store.api.lit.addSession(
        label,
        type,
        expiry,
        this.proxyServer,
        !IS_PROD,
        [],
      );

      // fetch all sessions to update the store's state
      await this.fetchSessions();

      if (session) {
        this.copyPhrase(session.label, session.pairingSecretMnemonic);
        return this.sessions.get(hex(session.localPublicKey));
      }
    } catch (error: any) {
      this._store.appView.handleError(error, 'Unable to add session');
    }
  }
Example #2
Source File: sessionStore.ts    From lightning-terminal with MIT License 5 votes vote down vote up
proxyServer = IS_PROD ? 'mailbox.terminal.lightning.today:443' : 'aperture:11110';