Skip to content
This repository has been archived by the owner on Jun 8, 2020. It is now read-only.

Commit

Permalink
Merge pull request #4 from RWOverdijk/patch-1
Browse files Browse the repository at this point in the history
update instructions for auth client
  • Loading branch information
Sid Ferreira authored Jul 12, 2017
2 parents 2162610 + b5807cf commit d631977
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ It stores a `firebaseToken` in `localStorage`.
...
import {RestClient, AuthClient} from 'aor-firebase-client';

const firebaseConfig = {
apiKey: '<your-api-key>',
authDomain: '<your-auth-domain>',
databaseURL: '<your-database-url>',
storageBucket: '<your-storage-bucket>',
messagingSenderId: '<your-sender-id>'
};

const App = () => (
<Admin restClient={RestClient(firebaseConfig)} authClient={AuthClient}>
<Resource name="posts" list={PostList} />
Expand All @@ -60,6 +68,31 @@ const App = () => (
export default App;
```

**Note:** AuthClient does require using the RestClient in order to initialize firebase. Alternatively, you can opt to not use the RestClient and initialize firebase yourself like this:

```js
import {RestClient, AuthClient} from 'aor-firebase-client';
import firebase from 'firebase';

const firebaseConfig = {
apiKey: '<your-api-key>',
authDomain: '<your-auth-domain>',
databaseURL: '<your-database-url>',
storageBucket: '<your-storage-bucket>',
messagingSenderId: '<your-sender-id>'
};

firebase.initializeApp(firebaseConfig);

const App = () => (
<Admin authClient={AuthClient}>
<Resource name="posts" list={PostList} />
</Admin>
);

export default App;
```

## Changelog

### v0.0.4
Expand Down

0 comments on commit d631977

Please sign in to comment.