Overview
Platform integration involves three parts:
- 1. Data Model: Store Byline fields for users and content
- 2. Admin UI: Let users configure their Byline data
- 3. Feed Generation: Include Byline elements in output feeds
Data Model
User/Author Fields
Extend your user or author model with:
| Field | Type | Notes |
|---|---|---|
byline_context | text (280 chars) | Bio/description for feeds |
byline_profiles | json array | [{href, rel}] |
byline_now_url | url | /now page URL |
byline_uses_url | url | /uses page URL |
byline_theme_color | string (7 chars) | #RRGGBB format |
byline_theme_accent | string (7 chars) | #RRGGBB format |
byline_theme_style | enum | light | dark | auto |
Post/Item Fields
| Field | Type | Notes |
|---|---|---|
byline_perspective | enum | personal, reporting, analysis, etc. |
byline_role | enum | creator, editor, guest, staff, etc. |
byline_affiliation_org | reference | FK to organization |
byline_affiliation_relationship | enum | employed, investor, sponsored, etc. |
byline_affiliation_title | string | Job title (optional) |
Progressive approach
You don't need to implement every field. Start with
context and perspective. They provide the most value with minimal complexity.Admin UI
User Profile Settings
Add a "Feed Identity" or "Byline" section to user settings:
- • Context: Textarea with character counter (280 max recommended)
- • Profile Links: Repeatable URL + platform dropdown
- • /now URL: URL input with description
- • /uses URL: URL input with description
- • Theme Colors: Color pickers for brand and accent
Post Editor
Add to post metadata or sidebar:
- • Perspective: Dropdown with common options
- • Affiliation: Optional disclosure section
// Example React component for perspective selector
function PerspectiveSelector({ value, onChange }) {
const options = [
{ value: '', label: 'None / Default' },
{ value: 'personal', label: 'Personal Opinion' },
{ value: 'reporting', label: 'News Reporting' },
{ value: 'analysis', label: 'Analysis' },
{ value: 'review', label: 'Review' },
{ value: 'tutorial', label: 'Tutorial' },
{ value: 'announcement', label: 'Announcement' },
{ value: 'sponsored', label: 'Sponsored Content' },
{ value: 'satire', label: 'Satire' },
];
return (
<select value={value} onChange={e => onChange(e.target.value)}>
{options.map(opt => (
<option key={opt.value} value={opt.value}>
{opt.label}
</option>
))}
</select>
);
}Feed Generation
When generating RSS, Atom, or JSON Feed output, include Byline data from your data model.
RSS Example
// Example PHP for WordPress-style feed generation
function add_byline_namespace($rss2) {
echo 'xmlns:byline="https://bylinespec.org/1.0"';
}
add_action('rss2_ns', 'add_byline_namespace');
function add_byline_contributors() {
$authors = get_users(['role__in' => ['author', 'editor']]);
echo '<byline:contributors>';
foreach ($authors as $author) {
$context = get_user_meta($author->ID, 'byline_context', true);
if ($context) {
echo '<byline:person id="' . esc_attr($author->user_nicename) . '">';
echo '<byline:name>' . esc_xml($author->display_name) . '</byline:name>';
echo '<byline:context>' . esc_xml($context) . '</byline:context>';
// ... more fields
echo '</byline:person>';
}
}
echo '</byline:contributors>';
}
add_action('rss2_head', 'add_byline_contributors');JSON Feed Example
// Example Node.js feed generation
function generateJsonFeed(posts, authors) {
return {
version: 'https://jsonfeed.org/version/1.1',
title: 'My Site',
// ... standard JSON Feed fields
_byline: {
version: 'https://bylinespec.org/1.0',
contributors: authors.map(author => ({
id: author.slug,
name: author.name,
context: author.bylineContext,
url: author.url,
avatar: author.avatarUrl,
profiles: author.bylineProfiles,
now: author.bylineNowUrl,
uses: author.bylineUsesUrl,
theme: author.bylineTheme,
})).filter(a => a.context), // Only include authors with context
},
items: posts.map(post => ({
id: post.id,
title: post.title,
// ... standard fields
_byline: {
author: post.author.slug,
perspective: post.bylinePerspective || undefined,
role: post.bylineRole || undefined,
affiliation: post.bylineAffiliation || undefined,
},
})),
};
}Best Practices
- • Keep standard elements. Always include standard RSS/Atom author elements alongside Byline.
- • Validate colors. Ensure theme colors are valid hex format before storing.
- • Default perspective. Don't require perspective; omit if not specified.
- • Guest authors. Support inline author definitions for guest posts.
- • Documentation. Tell your users about Byline and what it enables.
Reference implementations
We're working on reference implementations for popular platforms. Want to contribute? Check the GitHub repository.