import { useState, type FormEvent } from 'react'; import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import { api } from '../api/client'; import type { CreatedApiToken } from '../api/bindings/CreatedApiToken'; function Interests() { const qc = useQueryClient(); const interests = useQuery({ queryKey: ['interests'], queryFn: api.listInterests }); const [label, setLabel] = useState(''); const [weight, setWeight] = useState(0.5); const upsert = useMutation({ mutationFn: (body: { label: string; weight: number }) => api.upsertInterest(body), onSuccess: () => qc.invalidateQueries({ queryKey: ['interests'] }), }); const remove = useMutation({ mutationFn: (id: string) => api.deleteInterest(id), onSuccess: () => qc.invalidateQueries({ queryKey: ['interests'] }), }); const onAdd = (e: FormEvent) => { e.preventDefault(); if (!label.trim()) return; upsert.mutate({ label: label.trim(), weight }); setLabel(''); setWeight(0.5); }; return (
Positive weights pull matching stories up; negative weights bury them. These weights — and only these — decide your ranking.
No interests yet.
}
Agentic and algorithmic producers POST candidates to /v1/ingest/candidates with a bearer token.
Each token is scoped to your feed.
Copy this now — it won’t be shown again:
{fresh.secret}
No tokens yet.
}