Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MLIBZ-2332: Add support for Instance ID #278

Merged
merged 2 commits into from
Mar 29, 2018

Conversation

thomasconner
Copy link
Contributor

Description

Allow a user to provide aninstanceId config option to init() that will setup up the Kinvey API and MIC urls correctly.

const client = init({
  appKey: '<appKey>',
  appSecret: '<appSecret>',
  instanceId: '<my-subdomain>'
});
client.apiHostname // https://<my-subdomain>-baas.kinvey.com
client.micHostname // https://<my-subdomain>-auth.kinvey.com

Changes

  • Support config option instanceId in client.js constructor.

Tests

  • Added a test to client.spec.ts that checks if an error is thrown if instanceId is anything but a string
  • Added a test to client.spec.ts that checks if an instanceId is provided that the apiHostname and micHostname are correct.

@thomasconner thomasconner self-assigned this Mar 26, 2018
apiHostname = `https://${instanceId}-baas.kinvey.com`;
micHostname = `https://${instanceId}-auth.kinvey.com`;
} else {
if (isString(config.apiHostname)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As part of this ticket, the micHostname and apiHostname config options should be marked deprecated in the API reference. Also, the instanceId option should be documented in the API reference.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already did this. Take a look at the documentation comments above the function.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My mistake, I see it now. Can you make the following change?
"Deprecated: Host name used for Kinvey API requests": add the following - "Use the instanceID property instead"

LGTM overall.

tejasranade
tejasranade previously approved these changes Mar 28, 2018
Copy link
Contributor

@tejasranade tejasranade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thomasconner thomasconner merged commit 3aa5ea2 into master Mar 29, 2018
@thomasconner thomasconner deleted the MLIBZ-2332_InstanceID_Support branch March 29, 2018 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants