My App

Getting Started

Install SFRS and validate your first filing

Installation

npm install @sureshake/sfrs-validator @sureshake/sfrs-converter

Validate a Filing

import { validateFiling } from '@sureshake/sfrs-validator';

const filing = {
  sfrs: {
    version: "0.1",
    generatedAt: new Date().toISOString()
  },
  filing: {
    entity: {
      lei: "5493001KJTIIGC8Y1R12",
      name: "Your Company",
      jurisdiction: "US-DE"
    },
    period: {
      duration: { start: "2024-01-01", end: "2024-12-31" }
    },
    framework: "US-GAAP",
    submissionType: "10-K"
  },
  facts: {
    revenue: { value: 100000000, unit: "USD", decimals: -3 },
    netIncome: { value: 15000000, unit: "USD", decimals: -3 },
    totalAssets: { value: 80000000, unit: "USD", decimals: -3 }
  }
};

const result = validateFiling(filing);

if (result.valid) {
  console.log('Filing is valid!');
} else {
  console.log('Validation errors:', result.errors);
}

Convert to iXBRL

import { filingToIXBRL } from '@sureshake/sfrs-converter';

const ixbrl = filingToIXBRL(filing);

// Write to file
fs.writeFileSync('filing.html', ixbrl.content);

Create a Filing

const filing = {
  sfrs: {
    version: "0.1",
    generatedAt: new Date().toISOString(),
    generator: "Your App v1.0"
  },
  filing: {
    entity: {
      lei: "5493001KJTIIGC8Y1R12",
      name: "Acme Technology Corporation",
      jurisdiction: "US-DE",
      fiscalYearEnd: "--12-31",
      cik: "0001234567",
      ticker: "ACME",
      exchange: "XNAS"
    },
    period: {
      duration: { start: "2024-01-01", end: "2024-12-31" }
    },
    framework: "US-GAAP",
    submissionType: "10-K",
    auditor: {
      name: "Big Four LLP",
      pcaobId: "1234",
      opinion: "unqualified",
      opinionDate: "2025-02-28"
    }
  },
  facts: {
    revenue: { value: 4850000000, unit: "USD", decimals: -6 },
    costOfRevenue: { value: 2910000000, unit: "USD", decimals: -6 },
    grossProfit: { value: 1940000000, unit: "USD", decimals: -6 },
    netIncome: { value: 648000000, unit: "USD", decimals: -6 },
    totalAssets: { value: 6000000000, unit: "USD", decimals: -6 },
    totalLiabilities: { value: 2180000000, unit: "USD", decimals: -6 },
    totalStockholdersEquity: { value: 3820000000, unit: "USD", decimals: -6 }
  }
};

Next Steps

On this page