diff --git a/README.MD b/README.MD index 2a9a622..b584ad2 100644 --- a/README.MD +++ b/README.MD @@ -23,17 +23,61 @@ and set the configuration. ##### ClientConfig interface Bellow are all available parameters that can be provided in the `forRoot()` method. ```typescript -interface ClientConfig { - clientId: string; +export interface NgGapiClientConfig extends ClientConfig { discoveryDocs: string[]; - scope: string; - ux_mode?: string; - fetch_basic_profile?: boolean; +} + + +//And the extended ClientConfig +interface ClientConfig { + /** + * The app's client ID, found and created in the Google Developers Console. + */ + client_id?: string; + + /** + * The domains for which to create sign-in cookies. Either a URI, single_host_origin, or none. + * Defaults to single_host_origin if unspecified. + */ cookie_policy?: string; + + /** + * The scopes to request, as a space-delimited string. Optional if fetch_basic_profile is not set to false. + */ + scope?: string; + + /** + * Fetch users' basic profile information when they sign in. Adds 'profile' and 'email' to the requested scopes. True if unspecified. + */ + fetch_basic_profile?: boolean; + + /** + * The Google Apps domain to which users must belong to sign in. This is susceptible to modification by clients, + * so be sure to verify the hosted domain property of the returned user. Use GoogleUser.getHostedDomain() on the client, + * and the hd claim in the ID Token on the server to verify the domain is what you expected. + */ hosted_domain?: string; + + /** + * Used only for OpenID 2.0 client migration. Set to the value of the realm that you are currently using for OpenID 2.0, + * as described in OpenID 2.0 (Migration). + */ + openid_realm?: string; + + /** + * The UX mode to use for the sign-in flow. + * By default, it will open the consent flow in a popup. + */ + ux_mode?: "popup" | "redirect"; + + /** + * If using ux_mode='redirect', this parameter allows you to override the default redirect_uri that will be used at the end of the consent flow. + * The default redirect_uri is the current URL stripped of query parameters and hash fragment. + */ redirect_uri?: string; -} + } ``` + ##### Example: ```typescript let gapiClientConfig: NgGapiClientConfig = { @@ -148,12 +192,6 @@ Configure them according your google app configurations and resource scope. [Reporting API v4](https://developers.google.com/analytics/devguides/reporting/core/v4/rest/) - The scope is also in the documentation of the specific API , example for [Reporting API v4](https://developers.google.com/analytics/devguides/reporting/core/v4/rest/v4/reports/batchGet#authorization) -#### Examples - -The examples can be used as modules , you need a basic Angular2 project , then add the example module to your projects folder -and import the exampleModule in your AppModule - -- ng-gapi [Reporting API v4 example](https://github.com/rubenCodeforges/angular2-google-api/tree/master/examples) #### Promotion diff --git a/package.json b/package.json index ec7f159..490b464 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ng-gapi", - "version": "0.0.43", - "description": "Angular 4 Google api module ng-gapi", + "version": "0.0.44", + "description": "Angular 4+ Google api module ng-gapi", "main": "./lib/index.js", "typings": "./lib/index.d.ts", "scripts": { @@ -10,7 +10,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/rubenCodeforges/angular2-google-api.git" + "url": "git+https://github.com/rubenCodeforges/ng-gapi" }, "keywords": [ "Angular2", @@ -28,9 +28,9 @@ "author": "Ruben M", "license": "MIT", "bugs": { - "url": "https://github.com/rubenCodeforges/angular2-google-api/issues" + "url": "https://github.com/rubenCodeforges/ng-gapi/issues" }, - "homepage": "https://github.com/rubenCodeforges/angular2-google-api#readme", + "homepage": "https://github.com/rubenCodeforges/ng-gapi#readme", "dependencies": { "@types/gapi": "^0.0.35", "@types/gapi.auth2": "^0.0.44"