Developer Preview — This project is in active development. APIs may change. Provide feedback
Skip to content

@salesforce/b2c-tooling-sdk / docs / readDocByQuery

Function: readDocByQuery()

readDocByQuery(query): { content: string; entry: DocEntry; } | null

Defined in: packages/b2c-tooling-sdk/src/docs/search.ts:116

Reads documentation by fuzzy-matching the query and returning the best match.

Parameters

query

string

The search query string

Returns

{ content: string; entry: DocEntry; } | null

The best matching entry and its content, or null if no match

Example

typescript
const doc = readDocByQuery('ProductMgr');
if (doc) {
  console.log(`Found: ${doc.entry.title}`);
  console.log(doc.content);
}

Released under the Apache-2.0 License.