Skip to content

Commit

Permalink
Update install instructions (#206)
Browse files Browse the repository at this point in the history
* Update install instructions

- make `npm install` the default
- remove `cdn.firebase.com` because it is [deprecated](https://github.com/firebase/firebase-clients#updating-content)
    - add instructions for self-hosting the library
- move `bower install` to the bottom

* update ToC link
  • Loading branch information
jhuleatt committed Nov 9, 2020
1 parent 5898090 commit e8d0201
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions README.md
Expand Up @@ -20,39 +20,37 @@ and [Java](https://github.com/firebase/geofire-java).

## Table of Contents

* [Downloading GeoFire](#downloading-geofire)
* [Add GeoFire to your project](#add-geofire-to-your-project)
* [Documentation](#documentation)
* [Examples](#examples)
* [Release Notes](https://github.com/firebase/geofire-js/releases)
* [Migration Guides](#migration-guides)
* [Contributing](#contributing)

## Add GeoFire to your project

## Downloading GeoFire
The Firebase JS SDK is a peer dependency of GeoFire. Run the following command to install both libraries:

In order to use GeoFire in your project, you need to include the following files in your HTML:
```bash
$ npm install geofire firebase --save
```

### HTML

Alternatively, you can include GeoFire in your HTML. To do so download a minified or non-minified version of GeoFire from the [releases page of this GitHub repository](https://github.com/firebase/geofire-js/releases). Then, deploy it to Hosting in your Firebase project.

```html
<!-- Firebase -->
<script src="https://www.gstatic.com/firebasejs/5.9.4/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/5.9.4/firebase-database.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.0.1/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.0.1/firebase-database.js"></script>

<!-- GeoFire -->
<script src="https://cdn.firebase.com/libs/geofire/5.0.1/geofire.min.js"></script>
<!-- GeoFire (TODO: substitute in your own project id)-->
<script src="https://my-firebase-project.web.app/geofire-5.0.1.min.js"></script>
```

Use the URL above to download both the minified and non-minified versions of GeoFire from the
Firebase CDN. You can also download them from the
[releases page of this GitHub repository](https://github.com/firebase/geofire-js/releases).

You can also install GeoFire via npm or Bower. If downloading via npm, you will have to install
Firebase separately (because it is a peer dependency to GeoFire):

```bash
$ npm install geofire firebase --save
```
### Bower

On Bower, the Firebase dependency will be downloaded automatically:
If you use Bower, the Firebase dependency will be downloaded automatically:

```bash
$ bower install geofire --save
Expand Down

0 comments on commit e8d0201

Please sign in to comment.