
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@crosspost/types
Advanced tools
Shared type definitions for the Crosspost API and SDK.
This package contains TypeScript type definitions, including:
npm install @crosspost/types
// Import from JSR
import { PlatformName } from '@crosspost/types';
// Or import directly from GitHub
import { PlatformName } from 'https://raw.githubusercontent.com/your-org/crosspost/main/packages/types/mod.ts';
import { CreatePostRequest, CreatePostResponse, PlatformName } from '@crosspost/types';
// Use the types in your code
const platform: PlatformName = 'twitter';
const request: CreatePostRequest = {
targets: [{ platform: 'twitter', userId: 'your-twitter-id' }],
content: {
text: 'Hello, world!',
},
};
// Type checking for responses
function handleResponse(response: CreatePostResponse) {
console.log(`Post created with ID: ${response.id}`);
}
PlatformName - Supported social media platformsApiErrorCode - Error codes returned by the APIApiError - Error structure returned by the APIEnhancedApiResponse<T> - Standard response format with metadataEnhancedErrorResponse - Error response formatErrorDetail - Detailed error informationSuccessDetail - Success information for multi-status responsesMultiStatusResponse - Response format for operations with partial success/failurecreateEnhancedApiResponse - Create a standard responsecreateEnhancedErrorResponse - Create an error responsecreateErrorDetail - Create detailed error informationcreateSuccessDetail - Create success informationcreateMultiStatusResponse - Create a multi-status responseExample usage:
import { ApiErrorCode, createEnhancedApiResponse, createErrorDetail } from '@crosspost/types';
// Success response
const response = createEnhancedApiResponse({
id: '123',
text: 'Hello, world!',
});
// Error response
const errorResponse = createEnhancedErrorResponse([
createErrorDetail(
'Post not found',
ApiErrorCode.NOT_FOUND,
'twitter',
'user123',
false,
),
]);
FAQs
Shared type definitions for Crosspost API
We found that @crosspost/types demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.