Skip to content

Conversation

rohan-chaturvedi
Copy link
Member

Overview

The SDK currently requires that await init() is called before class methods like get or create can be called. Class methods run before init also return the misleading exception 'Invalid app id`

Proposed changes

Run init() internally if not called manually. The SDK now tracks the initialized state internally and will automatically call init() if not initialized. This means clients no longer need to await init():

const phase = new Phase(token, host)

await phase.get(getOptions) // This works without init now

await init() can still be run externally, so this is not a breaking change.

Miscellaneous other fixes

  • Made most internal variables private
  • Made env name checks for create, update, and delete case insensitive to be consistent with get
  • Bump version to 3.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant