> For the complete documentation index, see [llms.txt](https://cjho88793.gitbook.io/flamedb/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cjho88793.gitbook.io/flamedb/master.md).

# Home

### Installing

1. Install [node.js](https://nodejs.org/en/)
2. run `npm install flame.db`
3. You can get started working on your project!

## Docs

You can find the documentation [here](https://cjho88793.gitbook.io/flamedb/)

### Changelog

* Changed `.new()` into `.create()`
* Added event emitter

### Examples

```javascript
const FlameDB = require("flame.db");
const db = new FlameDB()
// Authenticate Service Account
db.authenticate(path-to-service-account)

// User is the collection, Hyp3r is your document. This will create a new collection.
db.create("user/hyp3r", {discord: "Hyp3r#0001"})

// User is the collection, Hyp3r is your document, and Projects is your array. This will push "FireDB" in "projects" array.
db.push("user/hyp3r/projects", "FireDB")

// This will return documents data as an object.
const data = await db.get("user/hyp3r")

// {discord: "Hyp3r#0001", alive: true}
db.set("user/hyp3r", {discord: "Hyp3r#0001", alive: true})

// {discord: "Hyp3r#1000", alive: true}
db.update("user/hyp3r", {discord: "Hyp3r#1000"})
```

### Connecting to Firebase

1. Visit [firebase](https://firebase.google.com) and make a new account if you haven't.
2. Create a new firebase project then go to **Cloud Firestore** then create a database.
3. Go to **Project Settings** and then click "Service Account" and make a new service account. You will then download a json file.
4. Copy all content from the json file and store it in your project.
5. Initialize your database.
6. You're all done!

### Initialize Database

```javascript
const FlameDB = require("flame.db")
const db = new FlameDB();

db.authenticate("path-to-service-account")

// Code Here
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cjho88793.gitbook.io/flamedb/master.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
