Search packages, repositories and app categories

Package detailsv0.6.0

typesense

Dart client library for accessing the HTTP API of Typesense search engine.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
7.8K
Likes
61
Pub points
130

Install package

flutter pub add typesense

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Dart client library that enables seamless integration with the Typesense search engine via its HTTP API. It provides a straightforward way to perform search operations, manage collections, and index documents across multiple platforms including Android, iOS, Web, macOS, Windows, and Linux. Designed for developers seeking fast, typo-tolerant search functionality in their Flutter applications, it abstracts low-level HTTP interactions while maintaining flexibility and performance.

Use cases

  • Real-time search in Flutter apps
  • Full-text search with typo tolerance
  • Indexing and managing document collections
  • Building autocomplete features
  • Integrating with existing Typesense servers
  • Search within mobile and web applications

Key features

  • Type-safe API wrappers
  • Cross-platform compatibility
  • Support for search, indexing, and schema management
  • Easy setup with Flutter pub
  • Built-in error handling
  • Lightweight and efficient

Suitable for

  • Flutter developers using Typesense
  • Apps requiring fast search capabilities
  • Projects needing cross-platform search
  • Developers integrating external search engines
  • Teams building search-heavy user interfaces

Considerations

  • Requires a running Typesense server
  • Limited to HTTP API functionality
  • No offline search support
  • Depends on network connectivity
  • Manual handling of complex query logic
  • Not suitable for local-only search needs

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Typesense

pub package github actions status pub likes pub points pub downloads

Dart client library for accessing the HTTP API of Typesense search engine.

Note: This package is still under development. Some existing APIs might change or new APIs might be available in the future.

Installation

Add typesense as a dependency in your pubspec.yaml file.

dependencies:
  typesense: ^0.6.0

Usage

Read the documentation here: https://typesense.org/docs/api/

Tests are also a good place to know how the library works internally: test

Note: When using this library in a user-facing app, please be sure to use an API Key that only allows search operations instead of the master API key. See keys.dart for an example of how to generate a search only API key.

See Configuration class for a list of all client configuration options.

Examples
import 'dart:io';

import 'package:typesense/typesense.dart';


void main() async {
  // Replace with your configuration
  final host = InternetAddress.loopbackIPv4.address, protocol = Protocol.http;
  final config = Configuration(
    // Api key
    'xyz',
    nodes: {
      Node(
        protocol,
        host,
        port: 7108,
      ),
      Node.withUri(
        Uri(
          scheme: 'http',
          host: host,
          port: 8108,
        ),
      ),
      Node(
        protocol,
        host,
        port: 9108,
      ),
    },
    numRetries: 3, // A total of 4 tries (1 original try + 3 retries)
    connectionTimeout: const Duration(seconds: 2),
  );

  final client = Client(config);

  final searchParameters = {
    'q': 'stark',
    'query_by': 'company_name',
    'filter_by': 'num_employees:>100',
    'sort_by': 'num_employees:desc'
  };

  await client.collection('companies').documents.search(searchParameters);
}

The examples that walk you through on how to use the client: main.dart

Make sure to README beforehand.

Compatibility

Typesense Server typesense-dart
>= v30.0 >= v0.6.0
>= v0.24.0 >= v0.5.0
>= v0.22.0 >= v0.3.0
>= v0.21.0 >= v0.1.1

Contributing

Visit CONTRIBUTING.md

Credits

This library is authored and maintained by our awesome community of contributors:

Categories

Dependencies

Dependency list 2 items

Source repository

Projects using this package

No data available yet.