{"id":31581324,"url":"https://github.com/huextrat/expo-core-spotlight","last_synced_at":"2025-10-05T21:56:20.505Z","repository":{"id":316066929,"uuid":"1061792936","full_name":"huextrat/expo-core-spotlight","owner":"huextrat","description":"Expo module implementing iOS Core Spotlight","archived":false,"fork":false,"pushed_at":"2025-09-30T09:35:32.000Z","size":438,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-30T11:35:31.304Z","etag":null,"topics":["expo","ios","react-native","spotlight","spotlight-search"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/expo-core-spotlight","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/huextrat.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-22T11:47:31.000Z","updated_at":"2025-09-29T14:46:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"3beaf59b-895d-42ef-8ff3-104e60a699d3","html_url":"https://github.com/huextrat/expo-core-spotlight","commit_stats":null,"previous_names":["huextrat/expo-core-spotlight"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/huextrat/expo-core-spotlight","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huextrat%2Fexpo-core-spotlight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huextrat%2Fexpo-core-spotlight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huextrat%2Fexpo-core-spotlight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huextrat%2Fexpo-core-spotlight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/huextrat","download_url":"https://codeload.github.com/huextrat/expo-core-spotlight/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huextrat%2Fexpo-core-spotlight/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278526240,"owners_count":26001326,"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-10-05T02:00:06.059Z","response_time":54,"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":["expo","ios","react-native","spotlight","spotlight-search"],"created_at":"2025-10-05T21:56:19.312Z","updated_at":"2025-10-05T21:56:20.500Z","avatar_url":"https://github.com/huextrat.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# 🔍 Expo Core Spotlight\n\n**Make your app content discoverable through iOS Spotlight search**\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/huextrat/expo-core-spotlight/blob/main/LICENSE\"\u003e\n    \u003cimg alt=\"License\" src=\"https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/expo-core-spotlight\"\u003e\n    \u003cimg alt=\"npm version\" src=\"https://img.shields.io/npm/v/expo-core-spotlight.svg?style=for-the-badge\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/expo-core-spotlight\"\u003e\n    \u003cimg alt=\"npm downloads\" src=\"https://img.shields.io/npm/dm/expo-core-spotlight.svg?style=for-the-badge\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n*An Expo module that provides access to iOS Core Spotlight functionality, allowing you to add, update, and remove items from the iOS Spotlight search index. When users tap on search results, your app will be opened with the corresponding deeplink.*\n\n\u003c/div\u003e\n\n---\n\n## ✨ Features\n\n- Add / Update / Remove items to iOS Spotlight search\n- Rich metadata support (title, description, keywords, URLs, dates, location, etc.)\n- Automatic deeplink handling when users tap search results\n\n---\n\n## 🚀 Quick Start\n\n### Installation\n\n```bash\n# Using npm\nnpm install expo-core-spotlight\n\n# Using yarn\nyarn add expo-core-spotlight\n\n# Using pnpm\npnpm add expo-core-spotlight\n\n# Using Expo CLI\nnpx expo install expo-core-spotlight\n```\n\n## ⚙️ Configuration\n\n### 1. Add the Plugin to Your App Config\n\nAdd the plugin to your `app.config.js` or `app.config.ts`:\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003e📄 app.config.js\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nexport default {\n  // ... your existing config\n  plugins: [\n    // ... your existing plugins\n    'expo-core-spotlight',\n  ],\n};\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003e📄 app.config.ts\u003c/strong\u003e\u003c/summary\u003e\n\n```typescript\nimport { ConfigContext } from 'expo/config';\n\nexport default ({ config }: ConfigContext) =\u003e ({\n  ...config,\n  plugins: [\n    ...(config.plugins || []),\n    'expo-core-spotlight',\n  ],\n});\n```\n\n\u003c/details\u003e\n\n### 2. 🔗 Deeplink Configuration\n\n\u003e **⚠️ Important:** The library uses the `uniqueIdentifier` as the deeplink URL.\n\nYou must include your app's URL scheme as a prefix in the `uniqueIdentifier` when creating Spotlight items.\n\n\u003cdiv align=\"center\"\u003e\n\n| ✅ **Correct** | ❌ **Incorrect** |\n|---|---|\n| `uniqueIdentifier: 'myapp://document/1'` | `uniqueIdentifier: 'document-1'` |\n| `uniqueIdentifier: 'myapp://user/123'` | `uniqueIdentifier: 'user-123'` |\n\n\u003c/div\u003e\n\n\u003e **ℹ️ Note:**  \n\u003e Currently, the library uses the `uniqueIdentifier` property as the deeplink URL for Spotlight items.  \n\u003e **In the future, this should be changed so that the `url` property is used as the deeplink instead of `uniqueIdentifier`.**  \n\u003e This will better align with iOS Core Spotlight best practices and make the API more intuitive.  \n\u003e For now, always include your app's URL scheme as a prefix in the `uniqueIdentifier`.\n\n\n## 📖 Usage\n\n### 🎯 Basic Example\n\n```typescript\nimport ExpoCoreSpotlight, { CoreSpotlightItem } from 'expo-core-spotlight';\n\n// Check if Core Spotlight is available\nconst isAvailable = await ExpoCoreSpotlight.isAvailable();\nconsole.log('Core Spotlight available:', isAvailable); // true on iOS, false on Android\n\n// Create a Spotlight item with deeplink in uniqueIdentifier\nconst item: CoreSpotlightItem = {\n  uniqueIdentifier: 'myapp://document/1', // Include your app scheme as prefix\n  title: 'My Important Document',\n  contentDescription: 'This is a sample document from my app',\n  keywords: ['document', 'important', 'my-app'],\n  url: 'myapp://document/1', // Optional: can be the same as uniqueIdentifier\n  domainIdentifier: 'com.myapp.documents',\n};\n\n// Add the item to Spotlight\nawait ExpoCoreSpotlight.indexItem(item);\n```\n\n### 🚀 Advanced Example\n\n```typescript\nimport ExpoCoreSpotlight, { CoreSpotlightItem } from 'expo-core-spotlight';\n\n// Add multiple items at once\nconst items: CoreSpotlightItem[] = [\n  {\n    uniqueIdentifier: 'myapp://document/1', // Deeplink as uniqueIdentifier\n    title: 'Document 1',\n    contentDescription: 'First document',\n    keywords: ['document', 'first'],\n    url: 'myapp://document/1',\n    domainIdentifier: 'com.myapp.documents',\n    rating: 4.5\n  },\n  {\n    uniqueIdentifier: 'myapp://document/2', // Deeplink as uniqueIdentifier\n    title: 'Document 2',\n    contentDescription: 'Second document',\n    keywords: ['document', 'second'],\n    url: 'myapp://document/2',\n    domainIdentifier: 'com.myapp.documents',\n    rating: 3.8\n  }\n];\n\nawait ExpoCoreSpotlight.indexItems(items);\n\n// Remove a specific item\nawait ExpoCoreSpotlight.removeItem('myapp://document/1');\n\n// Remove multiple items\nawait ExpoCoreSpotlight.removeItems(['myapp://document/2']);\n\n// Remove all items from a domain\nawait ExpoCoreSpotlight.removeAllItemsFromDomain('com.myapp.documents');\n\n// Remove all items\nawait ExpoCoreSpotlight.removeAllItems();\n```\n\n## 📚 API Reference\n\n### 🔧 Methods\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd width=\"50%\"\u003e\n\n#### `isAvailable(): Promise\u003cboolean\u003e`\nCheck if Core Spotlight is available on the device.\n- **Returns**: `true` on iOS, `false` on Android\n\n#### `indexItem(item: CoreSpotlightItem): Promise\u003cvoid\u003e`\nAdd or update a single item in the Spotlight index.\n\n#### `indexItems(items: CoreSpotlightItem[]): Promise\u003cvoid\u003e`\nAdd or update multiple items in the Spotlight index.\n\n\u003c/td\u003e\n\u003ctd width=\"50%\"\u003e\n\n#### `removeItem(uniqueIdentifier: string): Promise\u003cvoid\u003e`\nRemove a single item from the Spotlight index by its unique identifier.\n\n#### `removeItems(uniqueIdentifiers: string[]): Promise\u003cvoid\u003e`\nRemove multiple items from the Spotlight index by their unique identifiers.\n\n#### `removeAllItems(): Promise\u003cvoid\u003e`\nRemove all items from the Spotlight index.\n\n#### `removeAllItemsFromDomain(domainIdentifier: string): Promise\u003cvoid\u003e`\nRemove all items from a specific domain from the Spotlight index.\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n---\n\n## 📱 Platform Support\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd width=\"33%\" align=\"center\"\u003e\n\n**🍎 iOS**\n- Full Core Spotlight functionality\n- Automatic deeplink handling\n- Rich metadata support\n\n\u003c/td\u003e\n\u003ctd width=\"33%\" align=\"center\"\u003e\n\n**🤖 Android**\n- Empty implementations\n- Returns successfully but does nothing\n- No-op for compatibility\n\n\u003c/td\u003e\n\u003ctd width=\"33%\" align=\"center\"\u003e\n\n**🌐 Web**\n- Not supported\n- Will throw errors if used\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n---\n\n## 🛠️ Troubleshooting\n\n### 🚨 Common Issues\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003e🔗 Deeplinks not working\u003c/strong\u003e\u003c/summary\u003e\n\n**Problem**: Tapping search results doesn't open your app.\n\n**Solution**: Make sure your `uniqueIdentifier` includes your app's URL scheme:\n```typescript\n// ✅ Correct\nuniqueIdentifier: 'myapp://document/1'\n\n// ❌ Incorrect\nuniqueIdentifier: 'document-1'\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003e⚙️ Plugin not working\u003c/strong\u003e\u003c/summary\u003e\n\n**Problem**: Plugin changes aren't applied.\n\n**Solution**: \n1. Ensure you've added the plugin to your `app.config.js/ts`\n2. Run `npx expo prebuild` to regenerate native code\n3. Clean and rebuild your project\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003e🔍 Items not appearing in Spotlight\u003c/strong\u003e\u003c/summary\u003e\n\n**Problem**: Items don't show up in search results.\n\n**Solutions**:\n- ⏰ Wait a few minutes for iOS to index the items\n- 🔐 Check that your app has the necessary permissions\n- ✅ Verify that items have valid `title` and `uniqueIdentifier` properties\n- 🔄 Try removing and re-adding items\n\n\u003c/details\u003e\n\n---\n\n## 📄 License\n\nThis project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.\n\n---\n\n## 🤝 Contributing\n\nWe welcome contributions! Here's how you can help:\n\n1. 🍴 **Fork** the repository\n2. 🌿 **Create** a feature branch (`git checkout -b feature/amazing-feature`)\n3. 💾 **Commit** your changes (`git commit -m 'Add some amazing feature'`)\n4. 📤 **Push** to the branch (`git push origin feature/amazing-feature`)\n5. 🔄 **Open** a Pull Request\n\n### 🐛 Found a Bug?\n\nPlease open an issue with:\n- 📱 Device information\n- 📋 Steps to reproduce\n- 📸 Screenshots (if applicable)\n- 📝 Expected vs actual behavior\n\n### 💡 Have an Idea?\n\nWe'd love to hear your suggestions! Open an issue with the `enhancement` label.\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n**⭐ Star this repo if you found it helpful!**\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuextrat%2Fexpo-core-spotlight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuextrat%2Fexpo-core-spotlight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuextrat%2Fexpo-core-spotlight/lists"}