-
Notifications
You must be signed in to change notification settings - Fork 21
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
chore: update readme and examples for default credential provider and new topics callbacks #1429
Changes from all commits
8613e6a
1ad14d5
38e7040
9fc65aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,7 @@ | ||
import { | ||
CreateStoreResponse, | ||
CredentialProvider, | ||
PreviewStorageClient, | ||
StorageConfigurations, | ||
StorageGetResponse, | ||
StoragePutResponse, | ||
} from '@gomomento/sdk'; | ||
import {CreateStoreResponse, PreviewStorageClient, StorageGetResponse, StoragePutResponse} from '@gomomento/sdk'; | ||
|
||
async function main() { | ||
const storageClient = new PreviewStorageClient({ | ||
configuration: StorageConfigurations.Laptop.latest(), | ||
credentialProvider: CredentialProvider.fromEnvironmentVariable('MOMENTO_API_KEY'), | ||
}); | ||
const storageClient = new PreviewStorageClient({}); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should the props object itself become optional then? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good call, we could do that later, but I don't think it's a blocker for now. |
||
const storeName = 'my-store'; | ||
const createStoreResponse = await storageClient.createStore(storeName); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
/* eslint-disable @typescript-eslint/no-unused-vars */ | ||
import {CredentialProvider, PreviewStorageClient, StorageConfigurations} from '@gomomento/sdk'; | ||
import {PreviewStorageClient, StorageConfigurations} from '@gomomento/sdk'; | ||
|
||
const storageClient = new PreviewStorageClient({ | ||
configuration: StorageConfigurations.Laptop.latest(), | ||
credentialProvider: CredentialProvider.fromEnvironmentVariable('MOMENTO_API_KEY'), | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,6 @@ | |
"typescript": "4.9.5" | ||
}, | ||
"dependencies": { | ||
"@gomomento/sdk": "^1.97.0" | ||
"@gomomento/sdk": "^1.98.1" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
configuration
is actually optional now too; I just never went and updated the docs. (so thank you for being diligent about it!)I think we should leave plenty of examples of how to explicitly set these so that people will know, but in the examples where we omit them, we should omit both. I think this file is a good place to omit both, and whatever shows up in the main README is another good spot. Maybe also in the most basic example file for each product. But probably the rest of the places (e.g. the dictionary example) I'd leave the explicit versions in.
You can use your judgment on which files to update vs leave explicit, but let's go ahead and remove the explicit
configuration
option from any of the ones where you removecredentialProvider
.