https://github.com/dicebear/dicebear-go
Go implementation of DiceBear. Read-only subtree split of dicebear/dicebear - please open issues there.
https://github.com/dicebear/dicebear-go
Last synced: 1 day ago
JSON representation
Go implementation of DiceBear. Read-only subtree split of dicebear/dicebear - please open issues there.
- Host: GitHub
- URL: https://github.com/dicebear/dicebear-go
- Owner: dicebear
- License: mit
- Created: 2026-06-08T19:48:31.000Z (11 days ago)
- Default Branch: 10.x
- Last Pushed: 2026-06-13T14:16:54.000Z (6 days ago)
- Last Synced: 2026-06-13T16:15:57.215Z (6 days ago)
- Language: Go
- Homepage: https://github.com/dicebear/dicebear
- Size: 54.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
DiceBear Core (Go)
Go implementation of the DiceBear avatar library. Generates deterministic SVG
avatars from style definitions and a seed string.
DiceBear is available for multiple languages. All implementations share the same
PRNG and rendering pipeline, producing identical SVG output for the same seed,
style, and options, regardless of the language used.
[Playground](https://www.dicebear.com/playground) |
[Documentation](https://www.dicebear.com/how-to-use/go-library/)
## Installation
```sh
go get github.com/dicebear/dicebear-go/v10
```
Requires Go 1.23 or newer.
## Usage
```go
import (
dicebear "github.com/dicebear/dicebear-go/v10"
"github.com/dicebear/styles/v10"
)
// From a style definition (raw JSON, e.g. the pure-data styles module)
style, _ := dicebear.NewStyle([]byte(styles.Lorelei))
avatar, _ := dicebear.NewAvatar(style, map[string]any{
"seed": "John Doe",
"size": 128,
})
avatar.SVG() // SVG string
avatar.DataURI() // data:image/svg+xml;charset=utf-8,...
```
### Using the Style type
```go
style, _ := dicebear.NewStyle([]byte(styles.Lorelei))
// Create multiple avatars from the same style
avatar1, _ := dicebear.NewAvatar(style, map[string]any{"seed": "Alice"})
avatar2, _ := dicebear.NewAvatar(style, map[string]any{"seed": "Bob"})
```
## Sponsors
Advertisement: Many thanks to our sponsors who provide us with free or
discounted products.