interledgerjs / ilp-plugin-btp

This has been moved to the monorepo https://github.com/interledgerjs/interledgerjs
8 stars 7 forks source link

feat: allow account/token to be passed in via constructor #29

Closed sharafian closed 5 years ago

sharafian commented 5 years ago

Now, in addition to saying

new PluginBtp({
  server: 'btp+wss://account:secret@example.com'
})

You can say

new PluginBtp({
  server: 'btp+wss://example.com',
  btpAccount: 'account',
  btpToken: 'secret'
})

This especially fixes some issues we've seen in browsers, where some won't parse a URL that has an empty username field (i.e. btp+wss://:secret@example.com)

The names btpAccount and btpToken were chosen because they are unlikely to collide with the identifiers in any subclass (this._account is used by some children of plugin btp)

dino-rodriguez commented 5 years ago

Looks good.