mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-12-23 00:45:53 -05:00
NIP-24: Add User-Defined Custom Profile Fields
This commit is contained in:
parent
36fa8bb66f
commit
54e110b93a
27
24.md
27
24.md
|
@ -17,7 +17,32 @@ These are extra fields not specified in NIP-01 that may be present in the string
|
|||
- `website`: a web URL related in any way to the event author.
|
||||
- `banner`: an URL to a wide (~1024x768) picture to be optionally displayed in the background of a profile screen.
|
||||
- `bot`: a boolean to clarify that the content is entirely or partially the result of automation, such as with chatbots or newsfeeds.
|
||||
- `pronouns`: a string representing the preferred way to refer to this person.
|
||||
|
||||
### User defined custom fields
|
||||
|
||||
A `fields` attribute may also be added to profile metadata to represent user-defined fields. It is an array name-value tuples, eg:
|
||||
|
||||
```json
|
||||
[["<name>", "<value>"], ...]
|
||||
```
|
||||
|
||||
In the context of a full metadata object:
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "Alex",
|
||||
"avatar": "https://...",
|
||||
"fields": [
|
||||
["Pronouns", "ye/haw"],
|
||||
["Lifestyle", "vegan"],
|
||||
["Color", "green"]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
While protocol-level fields like `lud16` and `avatar` can influence the behavior of a user's account, custom fields are used for display purposes only. Clients should display custom fields in a confined area of the user's profile, and not make assumptions about their meaning.
|
||||
|
||||
Custom fields should be displayed in the order they are defined by the user, and entries may be duplicated. The name and value can be any string, although clients may truncate or ellipsize long values, and may limit the total number of fields displayed.
|
||||
|
||||
### Deprecated fields
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user