List
List
client.search.vals.list(ValListParamsquery, RequestOptionsoptions?): PageCursorURL<idstringauthorunioncodeunioncreatedAtstringlinksLinksnamestringprivacyunionpublicbooleantypeunionupdatedAtstringurlstringversionnumberValListResponse>
get/v1/search/vals
Search for vals across the platform
Parameters
querylimitnumberoffsetnumberquerystringValListParams
Returns
ValListResponse
A Val
import ValTown from '@valtown/sdk';
const client = new ValTown();
// Automatically fetches more pages as needed.
for await (const valListResponse of client.search.vals.list({ limit: 1, offset: 0, query: 'x' })) {
console.log(valListResponse.id);
}
200 Example
{
"data": [
{
"id": "00000000-0000-0000-0000-000000000000",
"author": {
"id": "00000000-0000-0000-0000-000000000000",
"username": "tmcw"
},
"code": "export const count = 1;",
"createdAt": "2024-06-11T22:05:12.585Z",
"links": {
"module": "https://example.com",
"self": "https://example.com",
"versions": "https://example.com",
"endpoint": "https://example.com"
},
"name": "counter",
"privacy": "public",
"public": true,
"type": "script",
"updatedAt": "2019-12-27T18:11:19.117Z",
"url": "https://val.town/v/tmcw/counter",
"version": 0
}
],
"links": {
"self": "https://example.com",
"next": "https://example.com",
"prev": "https://example.com"
}
}