README.md in nexaas_id-client-0.6.0 vs README.md in nexaas_id-client-0.7.0

- old
+ new

@@ -51,10 +51,23 @@ c.application_token = 'your-application-token' c.application_secret = 'your-application-secret' end ``` +Or, if you want to instantiate multiple application connections: + +```ruby +require 'nexaas_id' + +config = NexaasID.Configuration.build do |c| + c.url = 'https://sandbox.id.nexaas.com' + c.user_agent = 'My App v1.0' + c.application_token = 'your-application-token' + c.application_secret = 'your-application-secret' +end +``` + ## Usage The API can be used to access resources owned by an `Identity`, which requires previous authorization from the corresponding user (see the [omni_auth_nexaas_id gem](https://rubygems.org/gems/omni_auth_nexaas_id)), or resources owned by an `Application`, which only requires the application's credentials. @@ -65,10 +78,16 @@ ```ruby client = NexaasID::Client::Identity.new(user_credentials) ``` +Or passing an explicit configuration: + +```ruby +client = NexaasID::Client::Identity.new(user_credentials, config) +``` + Here, `user_crendentials` is an object that must have the following attributes available for reading/writing: * access_token * refresh_token * expires_in * expires_at @@ -119,11 +138,18 @@ ### Resources not owned by an Identity #### Create an instance of NexaasID::Client::Application, as below: + ```ruby client = NexaasID::Client::Application.new +``` + +Or passing a explicit configuration: + +```ruby +client = NexaasID::Client::Application.new(config) ``` #### Now you have access to the following endpoints: * [SignUp API](https://docs.id.nexaas.com/api/invitation) as `client.signup`