stitch-js-sdk

MongoDB Stitch JavaScript SDK

APACHE-2.0 License

Downloads
19.4K
Stars
113
Committers
23

Bot releases are hidden (Show)

stitch-js-sdk - Release 4.9.0 Latest Release

Published by adamchel over 4 years ago

This release introduces experimental support for watch on RemoteMongoCollection in React Native.

Thanks to changes made recently in React Native 0.62, networking primitives were exposed to make it possible to open an EventSource-based HTTP stream in React Native in a mobile-friendly way. See this thread and this PR for the work that went into making this possible. Big thanks to the React Native team for making this happen.

Right now, this will only work in the release candidate for React Native 0.62, so we are releasing this feature as an experimental pre-release feature.

If you'd like to try using watch in your Stitch apps, you can download this version of the SDK by:

npm install --save [email protected]
npm install --save mongodb-stitch-react-native-sdk@next

Note that you must specify the version or the next tag, otherwise you will get the version of the SDK that does not support watch in React Native.

stitch-js-sdk - Release 4.8.0

Published by jsflax almost 5 years ago

  • Add customData to user object
  • Add ability to refresh customData to StitchAuth
stitch-js-sdk - Release 4.7.0

Published by jsflax almost 5 years ago

  • Add Custom Function authentication auth provider
  • Add custom reset password function to UserPass auth provider
stitch-js-sdk - Release 4.5.0

Published by adamchel over 5 years ago

  • Adds support for additional options for watch in RemoteMongoCollection.
    • Watch for events on all documents.
    • Watch for all events matching a provided $match filter.
stitch-js-sdk - Release 4.4.1

Published by adamchel over 5 years ago

  • Fixes a bug where StitchAuthListener would not get a UserLoggedIn event on OAuth redirect logins.
stitch-js-sdk - Release 4.4.0

Published by adamchel over 5 years ago

  • Adds support for "compact" watch streams via the Remote MongoDB service, which can save on network usage when working with watch streams.
  • Fixes a bug where anonymous login sometimes failed due to an anonymous user already existing in storage.
  • Fixes a bug where issuing a request when logged out would cause a Promise to never be rejected.
  • Various internal improvements to the Stitch Admin SDK.
  • Various internal improvements to release process.
  • Various internal improvements to API documentation.
stitch-js-sdk - Release 4.3.2

Published by dkaminsky over 5 years ago

  • Properly closes watch streams when active user switches
  • Fixes authentication issue when using React Native
  • Fixes missing Buffer library issue in Angular applications
stitch-js-sdk - Release 4.3.1

Published by adamchel over 5 years ago

  • Adds support for findOne(), findOneAndUpdate(), findOneAndReplace(), and findOneAndDelete() on RemoteMongoCollection.
  • Fixes a bug where logging into an anonymous user would sometimes fail with an unhandled promise rejection.
  • Prevents users from calling logoutUser() and removeUser() with an argument in StitchAuth, to avoid accidentally logging out or deleting the active user when they meant to log out or delete another user.
  • Adds a copy-to-clipboard button in the code snippets in the generated documentation.
  • Fixes various linter errors in the codebase.
stitch-js-sdk - Release 4.3.0

Published by adamchel over 5 years ago

  • Adds support for multiple logged-in users. You can now log into multiple users on a single device, switch between them, and maintain profile information for logged out users. See the docs for StitchAuth for information about the new functionality.
  • Revamps the StitchAuthListener interface, which now provides contextual information about auth events as they occur on the Stitch client. See the docs for StitchAuthListener for more information.
  • Adds isLoggedIn and lastAuthActivity field to the StitchUser interface,
    • isLoggedIn is a boolean indicating whether a user is currently logged in (and can thus be switched to).
    • lastAuthActivity is a Date indicating the last time the user was logged in, logged out, switched to, or switched from.
  • Made various cosmetic improvements to the generated TypeDoc API documentation, and added code examples to many pages.
  • Removes cross-fetch as a dependency from mongodb-stitch-core-sdk, and provided a platform-specific fetch transport for each platform SDK and a JestFetchTransport for test modules. This is to solve issues where some applications could not be built with node-fetch as a dependency. (See #207)
stitch-js-sdk - Release 4.2.0

Published by adamchel over 5 years ago

  • Adds a new watch method on RemoteMongoCollection for the browser SDK and Node.js SDK. watch provides the ability to open a change stream against a collection to get real-time updates about changes that happen on specific documents.
    • This feature is not supported on React Native due to a lack of mature support for server-event events on that platform. If you’d like real-time updates in a React Native application, we recommend building a native module using our iOS and Android SDKs, which offer beta functionality for MongoDB Mobile Sync, and will soon offer similar watch functionality
  • Improved README files
  • Fixed various internal issues
stitch-js-sdk - Release 4.1.3

Published by adamchel over 5 years ago

  • Various improvements to documentation comments, and generated TypeDoc documentation.
  • Added BSON as an export of the browser, server and react-native SDKs. This means you no longer need to separately import BSON to use native BSON types like BSON.ObjectId. See the README.md for each respective SDK for example usage.
  • Fixed a bug where logging in with a redirect credential was broken due to using an improper base URL for certain types of Stitch applications.
stitch-js-sdk - Release 4.1.2

Published by adamchel almost 6 years ago

  • Fixed a bug where the headers in the response object of the HTTP service contained undefined values before the actual values contained in the header.
stitch-js-sdk - Release 4.1.1

Published by dkaminsky almost 6 years ago

  • Support for contacting applications deployed with a "local" deployment model
    • Before the first call to the client v2 API, the SDK now contacts the global stitch server to find out the deployment model and localized hostname for the application. The call is then redirected to the localized hostname (e.g. calls to Stitch for an app deployed locally to US-VA will hit a stitch server residing specifically in that location, while an app deployed globally will always use the global Stitch URL)
    • Subsequent calls to the API use the cached result
  • Added toArray to all find operations, with soft deprecation of asArray
    • This creates parity between this and the Function JS SDK
stitch-js-sdk - Release 4.1.0

Published by adamchel almost 6 years ago

  • Packages are no longer exposed as UMD modules. Packages are exposed as either a CommonJS module (via the “main” field in “package.json”), or as an ES6 module (via the “module” field in "package.json").
    • This was done because the React Native bundler cannot handle UMD modules produced by TypeScript (https://github.com/facebook/metro/issues/225). Most use cases that were handled using our UMD modules as AMD modules can now be handled using our ES6 modules, or our pre-bundled hosted modules as described in our Browser SDK README. Please open an issue if you have any trouble using the SDK.
    • As a side-effect, the React Native SDK now officially supports the latest version of React Native (0.57.0)
  • minAge and maxAge in StitchUserProfile are now exposed as Strings instead of numbers. This is to more accurately the reflect the response returned from the API, and to protect against invalid API responses that aren’t numbers
  • Fixed a bug in getAppClient in the Stitch class that prevented getting initialized app clients without an error being thrown.
stitch-js-sdk - Release 4.0.13

Published by adamchel about 6 years ago

  • Added generic AWS service
    • New NPM packages:
      • mongodb-stitch-browser-services-aws
      • mongodb-stitch-server-services-aws
      • mongodb-stitch-react-native-services-aws
  • Exposed StitchServiceClient to support services which are not well-defined by the SDK
stitch-js-sdk - Release 3.0.1

Published by edaniels over 6 years ago

3.0.1

Note: A previous 3.0.0 version was unpublished from NPM and this version serves as the 3.0.0 release.

Usage of StitchClient

StitchClient can longer be constructed directly. Instead, StitchClientFactory has been introduced to asynchronously perform any initialization steps needed to create a StitchClient. StitchClientFactory has a function called create that will return a Promise that will resolve with a StitchClient after initialization. The resolved client should be used for the lifetime of the application.

Migration Path

// old, 2.x.x usage
import { StitchClient } from 'mongodb-stitch';
const stitchClient = new StitchClient('<app-id>');
stitchClient.login().then(authedId => console.log(authedId));
// app initialization code

// new, 3.x.x usage
import { StitchClientFactory } from 'mongodb-stitch';
const stitchClientPromise = StitchClientFactory.create('<app-id>');
stitchClientPromise.then(stitchClient => stitchClient.login().then(authedId => {
	console.log(authedId);
	initializeApp(stitchClient);
}));

Since the StitchClient is only available after the Promise resolves, initialization of an app should be deferred until this time and the client reference should be passed to some initialization component/function.

NOTE: Attempting to construct a StitchClient without using StitchClientFactory will result in an error being thrown.

Multiple Apps

  • Add support for multiple StitchClients (with different associated applications).

Authentication

Previously, logging in with a provider while already logging caused no log in to happen which proved to be confusing. These new semantics are in effect:

  • Authenticating multiple times with anonymous authentication while already authenticated anonymously does nothing and returns the current user ID.
  • Authenticating with any provider but anonymous will log out the current user and then log in with the new provider.
  • Add isAuthenticated() method to the StitchClient class. This method should be used to check if any authentication work needs to happen. It returns a boolean declaring whether or not the current client is authenticated.
  • Add Client API key management. This feature allows one to create API keys linked to the currently logged in user. This does not work on anonymous users or Server API key users.

Services

  • Add missing findOne() method to the MongoDB service class.

Miscellaneous

  • Expose BSON module directly alongside StitchClientFactory.
stitch-js-sdk - 3.0.0 Release

Published by edaniels over 6 years ago

3.0.0

Usage of StitchClient

StitchClient can longer be constructed directly. Instead, StitchClientFactory has been introduced to asynchronously perform any initialization steps needed to create a StitchClient. StitchClientFactory has a function called create that will return a Promise that will resolve with a StitchClient after initialization. The resolved client should be used for the lifetime of the application.

Migration Path

// old, 2.x.x usage
import { StitchClient } from 'mongodb-stitch';
const stitchClient = new StitchClient('<app-id>');
stitchClient.login().then(authedId => console.log(authedId));
// app initialization code

// new, 3.x.x usage
import { StitchClientFactory } from 'mongodb-stitch';
const stitchClientPromise = StitchClientFactory.create('<app-id>');
stitchClientPromise.then(stitchClient => stitchClient.login().then(authedId => {
	console.log(authedId);
	initializeApp(stitchClient);
}));

Since the StitchClient is only available after the Promise resolves, initialization of an app should be deferred until this time and the client reference should be passed to some initialization component/function.

NOTE: Attempting to construct a StitchClient without using StitchClientFactory will result in an error being thrown.

Multiple Apps

  • Add support for multiple StitchClients (with different associated applications).

Authentication

Previously, logging in with a provider while already logging caused no log in to happen which proved to be confusing. These new semantics are in effect:

  • Authenticating multiple times with anonymous authentication while already authenticated anonymously does nothing and returns the current user ID.
  • Authenticating with any provider but anonymous will log out the current user and then log in with the new provider.
  • Add isAuthenticated() method to the StitchClient class. This method should be used to check if any authentication work needs to happen. It returns a boolean declaring whether or not the current client is authenticated.
  • Add Client API key management. This feature allows one to create API keys linked to the currently logged in user. This does not work on anonymous users or Server API key users.

Services

  • Add missing findOne() method to the MongoDB service class.

Miscellaneous

  • Expose BSON module directly alongside StitchClientFactory.
Package Rankings
Top 2.51% on Npmjs.org
Badges
Extracted from project README
Join the chat at https://gitter.im/mongodb/stitch
Related Projects