{"id":30240372,"url":"https://github.com/mixcore/javascript-sdk","last_synced_at":"2025-08-15T04:38:08.855Z","repository":{"id":307408175,"uuid":"1029227092","full_name":"mixcore/javascript-sdk","owner":"mixcore","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-14T09:16:29.000Z","size":261,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-14T11:26:06.359Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mixcore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-30T17:58:41.000Z","updated_at":"2025-08-14T09:16:32.000Z","dependencies_parsed_at":"2025-07-31T05:40:28.490Z","dependency_job_id":null,"html_url":"https://github.com/mixcore/javascript-sdk","commit_stats":null,"previous_names":["mixcore/javascript-sdk"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mixcore/javascript-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mixcore%2Fjavascript-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mixcore%2Fjavascript-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mixcore%2Fjavascript-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mixcore%2Fjavascript-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mixcore","download_url":"https://codeload.github.com/mixcore/javascript-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mixcore%2Fjavascript-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270524409,"owners_count":24600195,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-15T02:00:12.559Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-15T04:38:04.063Z","updated_at":"2025-08-15T04:38:08.848Z","avatar_url":"https://github.com/mixcore.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mixcore JavaScript SDK\n\n![Mixcore Logo](https://mixcore.net/images/logo.svg)\n\nModular, framework-agnostic SDK for Mixcore projects. Built with TypeScript and distributed as ESM/CJS modules.\n\n## Features\n\n- **Modular architecture**: Import only what you need\n- **TypeScript-first**: Full type safety and autocompletion\n- **Framework-agnostic**: Works with any JavaScript framework\n- **Production-ready**: Well-tested and documented\n- **Secure by design**: Configuration injection prevents hardcoded secrets\n- **Extensible**: Plugin/adapter architecture for custom implementations\n\n## Packages\n\n| Package | Description |\n|--------|-------------|\n| [@mixcore/shared](packages/shared) | Shared utilities, helpers and constants |\n| [@mixcore/base](packages/base) | Base classes, abstract models and interfaces |\n| [@mixcore/api](packages/api) | API clients and endpoint wrappers |\n| [@mixcore/config](packages/config) | Configuration management |\n| [@mixcore/database](packages/database) | Database domain services |\n| [@mixcore/file](packages/file) | File handling utilities |\n| [@mixcore/user](packages/user) | User/auth services |\n| [@mixcore/template](packages/template) | Template rendering services |\n\n## Getting Started\n\n### Installation\n\n```bash\nnpm install @mixcore/api @mixcore/database # or whichever packages you need\n```\n\n### SDK Initialization\n\n```typescript\nimport { createMixcoreSdk } from '@mixcore/api';\nimport { ApiService } from '@mixcore/api';\nimport { ModuleDataService } from '@mixcore/database';\n\n// Initialize SDK with configuration\nconst sdk = createMixcoreSdk(\n  { apiBaseUrl: 'https://api.mixcore.net' },\n  {\n    api: new ApiService({ apiBaseUrl: 'https://api.mixcore.net' }),\n    database: new ModuleDataService({ api: new ApiService({ apiBaseUrl: 'https://api.mixcore.net' }) })\n    // Add other domain services as needed\n  }\n);\n\n// Use services through SDK instance\nconst data = await sdk.database.fetchDataItems('module-id');\n```\n\n### Security Note\n\n- Never hardcode secrets in your application\n- Always inject configuration (API keys, URLs) at runtime\n- Use environment variables for sensitive values\n\n## API Reference\n\n### Core SDK Methods\n\n| Method | Parameters | Returns | Description |\n|--------|------------|---------|-------------|\n| `createMixcoreSdk` | `config: MixcoreSdkConfig`, `services: MixcoreSdkOptions` | `MixcoreSdkInstance` | Creates configured SDK instance |\n\n### Configuration Options\n\n| Option | Type | Required | Description |\n|--------|------|----------|-------------|\n| `apiBaseUrl` | string | Yes | Base URL for API requests |\n| `apiKey` | string | No | API key for authentication |\n| `timeout` | number | No | Request timeout in ms |\n\n## Development\n\n### Prerequisites\n\n- Node.js 18+\n- pnpm\n\n### Setup\n\n```bash\ngit clone https://github.com/mixcore/javascript-sdk.git\ncd javascript-sdk\npnpm install\n```\n\n### Building\n\n```bash\npnpm build\n```\n\n### Testing\n\n```bash\npnpm test\n```\n\nTest coverage reports are generated in `coverage/` directory.\n\n## CI/CD Pipeline\n\nThe SDK uses GitHub Actions for continuous integration and deployment:\n\n1. **Validate**: Runs linting and type checking\n2. **Test**: Runs unit tests with coverage reporting via Codecov\n3. **Publish**: Automatically publishes to npm on main branch merges\n\n### Publishing Requirements\n\n- All packages must pass tests with minimum 80% coverage\n- Version numbers must follow semantic versioning\n- NPM_TOKEN secret must be configured in GitHub\n\n## Contributing\n\nContributions welcome! Please see our [Contribution Guidelines](CONTRIBUTING.md).\n\n## Framework Integration\n\nThe SDK is framework-agnostic but here are guidelines for popular frameworks:\n\n### React\n\n```typescript\n// Create a context/provider for the SDK\nimport { createContext } from 'react';\nimport { createMixcoreSdk } from '@mixcore/api';\n\nconst SdkContext = createContext(null);\n\nfunction App() {\n  const sdk = createMixcoreSdk(\n    { apiBaseUrl: process.env.REACT_APP_API_URL },\n    { /* services */ }\n  );\n\n  return (\n    \u003cSdkContext.Provider value={sdk}\u003e\n      {/* Your app */}\n    \u003c/SdkContext.Provider\u003e\n  );\n}\n```\n\n### Vue\n\n```typescript\n// Provide SDK instance via Vue's provide/inject\nimport { createApp } from 'vue';\nimport { createMixcoreSdk } from '@mixcore/api';\n\nconst app = createApp(App);\n\napp.provide('mixcoreSdk', createMixcoreSdk(\n  { apiBaseUrl: import.meta.env.VITE_API_URL },\n  { /* services */ }\n));\n```\n\n### Angular\n\n```typescript\n// Create an injectable service wrapper\nimport { Injectable } from '@angular/core';\nimport { createMixcoreSdk } from '@mixcore/api';\n\n@Injectable({ providedIn: 'root' })\nexport class MixcoreService {\n  sdk = createMixcoreSdk(\n    { apiBaseUrl: environment.apiUrl },\n    { /* services */ }\n  );\n}\n```\n\n### Svelte/SvelteKit\n\n```typescript\n// Use Svelte stores for SDK instance\nimport { writable } from 'svelte/store';\nimport { createMixcoreSdk } from '@mixcore/api';\n\nexport const sdk = writable(createMixcoreSdk(\n  { apiBaseUrl: import.meta.env.VITE_API_URL },\n  { /* services */ }\n));\n```\n\n## License\n\nMixcore Community License (MCL). See [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmixcore%2Fjavascript-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmixcore%2Fjavascript-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmixcore%2Fjavascript-sdk/lists"}