![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
trm-tb-plugin
Advanced tools
npm i trm-tb-plugin
The plugin exports a useFetchPipe
function that provides a single interface to easily query Tinybird pipes using SWR.
Note: Only JSON responses are supported for now and SWR ^2.0.0
is required.
Arguments:
name
: The name of the Tinybird pipe.queryParams
(optional): The query parameters of the pipe as a JSON-object.config
(optional): The Tinybird configuration as a JSON-object.responseType
(optional): The API response type. 'JSON' | 'CSV' | 'Ndjson' | 'Parquet'
Example:
// Example.tsx
import { useFetchPipe } from 'trm-tb-plugin';
import { LineChart } from '@tremor/react';
export default function Example() {
const { data, status } = useFetchPipe('my_sales_data_pipe', {
date_from: '2023-01-01',
date_to: '2023-03-01'
});
return status === 'loading' ? (
<p>Loading...</p>
) : (
<LineChart data={data} index="date" categories={['sales', 'profit']} />
);
}
Configuration parameters:
token
: The Tinybird auth tokenbaseUrl
(optional): The Tinybird API base url, i.e. the tinybird pipe prefix up to the pipe name. Default: https://api.tinybird.co/v0/pipes/
(1) Using the TbConfigProvider
:
// ContextProvider.tsx
import { TbConfigProvider } from 'trm-tb-plugin';
export default function ContextProvider({ children }) {
const [token, setToken] = useState('<my tinybird auth token>');
// Optional
const [baseUrl, setBaseUrl] = useState('https://ui.us-east.tinybird.co/v0/pipes/');
return (
<TbConfigProvider token={token} setToken={setToken} baseUrl={baseUrl} setBaseUrl={setBaseUrl}>
{children}
</TbConfigProvider>
);
}
The config values can be set in one of the TbConfigProvider
s child components using the TbConfigContext
and the provided setters:
// Example.tsx
import { TbConfigContext } from 'trm-tb-plugin';
import { useContext } from 'react';
...
const { setToken, setBaseUrl } = useContext(TbConfigContext);
...
Once the config parameters are set in the TbConfigProvider
, the useFetchPipe
function will automatically obtain the config from the TbConfigContext
.
(2) Directly providing a config via the config
argument of the useFetchPipe
as a JSON-object.
const { data } = useFetchPipe(
'my_pipe',
{
date_from: '2023-01-01',
date_to: '2023-03-01'
},
{
token: '<my tinybird token>',
// Optional
baseUrl: 'https://api.us-east.tinybird.co/v0/pipes/'
}
);
FAQs
Plugin to fetch data from Tinybird.
The npm package trm-tb-plugin receives a total of 1 weekly downloads. As such, trm-tb-plugin popularity was classified as not popular.
We found that trm-tb-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.