de8cab86ca
* add block parent * Use consts for parent types in page unmarshal Co-authored-by: David Stotijn <dstotijn@gmail.com> |
||
---|---|---|
.github/workflows | ||
examples | ||
block.go | ||
client_test.go | ||
client.go | ||
comment.go | ||
cover.go | ||
database.go | ||
error.go | ||
file.go | ||
go.mod | ||
go.sum | ||
icon.go | ||
LICENSE | ||
page.go | ||
parent.go | ||
README.md | ||
rich_text.go | ||
search.go | ||
time_test.go | ||
time.go | ||
user.go | ||
util.go |
go-notion
go-notion is a client for the Notion API, written in Go.
Features
The client supports all (non-deprecated) endpoints available in the Notion API, as of September 4, 2022:
Search
Comments
Installation
$ go get github.com/dstotijn/go-notion
Usage
To obtain an API key, follow Notion’s getting started guide.
import "github.com/dstotijn/go-notion"
(...)
client := notion.NewClient("secret-api-key")
page, err := client.FindPageByID(context.Background(), "18d35eb5-91f1-4dcb-85b0-c340fd965015")
if err != nil {
// Handle error...
}
👉 Check out the docs on pkg.go.dev for a complete reference and the examples directory for more example code.
Status
The Notion API itself is out of beta. This library is updated periodically following documented changes from the Notion changelog.
Note: This library will make breaking changes in its code until
v1.0
of the module is released. There are no immediate plans for a v1.0
release. I want the design choices to be solidified and battle-tested more
before committing to a stable release (and the possible burden of a "v2+" Go
module should I want to introduce breaking changes).
License
© 2022 David Stotijn