Skip to content

Instantly share code, notes, and snippets.

@mainawycliffe
Last active November 6, 2022 21:37
Show Gist options
  • Save mainawycliffe/df23f7ae32404a1ab4773caef1b5860e to your computer and use it in GitHub Desktop.
Save mainawycliffe/df23f7ae32404a1ab4773caef1b5860e to your computer and use it in GitHub Desktop.
// we will use a service account to authenticate and authorize our app
clientOptions := option.WithCredentialsFile("path/to/serviceAccountKey.json")
app, err := firebase.NewApp(context.TODO(), nil, clientOptions)
if err != nil {
log.Fatalln(err)
}
client, err := app.Firestore(ctx)
if err != nil {
log.Fatalln(err)
}
defer client.Close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment