mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2025-08-27 04:59:22 +00:00
Add t-tag guidance
This commit is contained in:
parent
db09c45a54
commit
9625533ed4
25
CONTEXT.md
25
CONTEXT.md
@ -189,6 +189,31 @@ When designing tags for Nostr events, follow these principles:
|
|||||||
const events = await nostr.query([{ kinds: [30402], '#t': ['electronics'] }]);
|
const events = await nostr.query([{ kinds: [30402], '#t': ['electronics'] }]);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### `t` Tag Filtering for Community-Specific Content
|
||||||
|
|
||||||
|
For applications focused on a specific community or niche, you can use `t` tags to filter events for the target audience.
|
||||||
|
|
||||||
|
**When to Use:**
|
||||||
|
- ✅ Community apps: "farmers" → `t: "farming"`, "Poland" → `t: "poland"`
|
||||||
|
- ❌ Generic platforms: Twitter clones, general Nostr clients
|
||||||
|
|
||||||
|
**Implementation:**
|
||||||
|
```typescript
|
||||||
|
// Publishing with community tag
|
||||||
|
createEvent({
|
||||||
|
kind: 1,
|
||||||
|
content: data.content,
|
||||||
|
tags: [['t', 'farming']]
|
||||||
|
});
|
||||||
|
|
||||||
|
// Querying community content
|
||||||
|
const events = await nostr.query([{
|
||||||
|
kinds: [1],
|
||||||
|
'#t': ['farming'],
|
||||||
|
limit: 20
|
||||||
|
}], { signal });
|
||||||
|
```
|
||||||
|
|
||||||
### Kind Ranges
|
### Kind Ranges
|
||||||
|
|
||||||
An event's kind number determines the event's behavior and storage characteristics:
|
An event's kind number determines the event's behavior and storage characteristics:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user