Skip to content

Atom Feed Reference

Atom is a syndication format based on XML that provides a robust framework for web feeds. Feedsmith provides comprehensive parsing and generation capabilities.

Versions0.3, 1.0
NamespacesDublin Core, Syndication, Slash, iTunes, Media RSS, GeoRSS-Simple, Atom Threading, Dublin Core Terms, Well-Formed Web

Type Definition

INFO

TDate represents date fields in the type definitions. When parsing, dates are returned as strings in their original format (see Parsing › Handling Dates for more details). When generating, dates should be provided as JavaScript Date objects.

ts
// For simplicity's sake, a string is used for now, but this may be reconsidered in the future.
export type Text = string

export type Link<TDate extends DateLike> = {
  href: string
  rel?: string
  type?: string
  hreflang?: string
  title?: string
  length?: number
  thr?: ThrLink<TDate>
}

export type Person = {
  name: string
  uri?: string
  email?: string
}

export type Category = {
  term: string
  scheme?: string
  label?: string
}

export type Generator = {
  text: string
  uri?: string
  version?: string
}

export type Source<TDate extends DateLike> = {
  authors?: Array<Person>
  categories?: Array<Category>
  contributors?: Array<Person>
  generator?: Generator
  icon?: string
  id?: string
  links?: Array<Link<TDate>>
  logo?: string
  rights?: Text
  subtitle?: Text
  title?: Text
  updated?: TDate
}

export type Entry<TDate extends DateLike> = {
  authors?: Array<Person>
  categories?: Array<Category>
  content?: Text
  contributors?: Array<Person>
  id: string
  links?: Array<Link<TDate>>
  published?: TDate
  rights?: Text
  source?: Source<TDate>
  summary?: Text
  title: Text
  updated: TDate
  dc?: DcItemOrFeed<TDate>
  dcterms?: DctermsItemOrFeed<TDate>
  slash?: SlashItem
  itunes?: ItunesItem
  media?: MediaItemOrFeed
  georss?: GeoRssItemOrFeed
  thr?: ThrItem
  wfw?: WfwItem
  yt?: YtItem
}

export type Feed<TDate extends DateLike> = {
  authors?: Array<Person>
  categories?: Array<Category>
  contributors?: Array<Person>
  generator?: Generator
  icon?: string
  id: string
  links?: Array<Link<TDate>>
  logo?: string
  rights?: Text
  subtitle?: Text
  title: Text
  updated: TDate
  entries?: Array<Entry<TDate>>
  dc?: DcItemOrFeed<TDate>
  dcterms?: DctermsItemOrFeed<TDate>
  sy?: SyFeed<TDate>
  itunes?: ItunesFeed
  media?: MediaItemOrFeed
  georss?: GeoRssItemOrFeed
  yt?: YtFeed
}