• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / supabase-js / 16472859267

23 Jul 2025 02:01PM UTC coverage: 72.199% (-0.7%) from 72.889%
16472859267

Pull #1506

github

web-flow
Merge dd91c262a into 1b5325dfa
Pull Request #1506: fix: add Node 18 deprecation notice

59 of 100 branches covered (59.0%)

Branch coverage included in aggregate %.

6 of 9 new or added lines in 1 file covered. (66.67%)

115 of 141 relevant lines covered (81.56%)

24.87 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.0
/src/index.ts
1
import SupabaseClient from './SupabaseClient'
3✔
2
import type { GenericSchema, SupabaseClientOptions } from './lib/types'
3

4
export * from '@supabase/auth-js'
3✔
5
export type { User as AuthUser, Session as AuthSession } from '@supabase/auth-js'
6
export {
3✔
7
  type PostgrestResponse,
8
  type PostgrestSingleResponse,
9
  type PostgrestMaybeSingleResponse,
10
  PostgrestError,
3✔
11
} from '@supabase/postgrest-js'
12
export {
3✔
13
  FunctionsHttpError,
3✔
14
  FunctionsFetchError,
3✔
15
  FunctionsRelayError,
3✔
16
  FunctionsError,
3✔
17
  type FunctionInvokeOptions,
18
  FunctionRegion,
3✔
19
} from '@supabase/functions-js'
20
export * from '@supabase/realtime-js'
3✔
21
export { default as SupabaseClient } from './SupabaseClient'
6✔
22
export type { SupabaseClientOptions, QueryResult, QueryData, QueryError } from './lib/types'
23

24
/**
25
 * Creates a new Supabase Client.
26
 */
27
export const createClient = <
3✔
28
  Database = any,
29
  SchemaName extends string & keyof Database = 'public' extends keyof Database
30
    ? 'public'
31
    : string & keyof Database,
32
  Schema extends GenericSchema = Database[SchemaName] extends GenericSchema
33
    ? Database[SchemaName]
34
    : any
35
>(
36
  supabaseUrl: string,
37
  supabaseKey: string,
38
  options?: SupabaseClientOptions<SchemaName>
39
): SupabaseClient<Database, SchemaName, Schema> => {
40
  return new SupabaseClient<Database, SchemaName, Schema>(supabaseUrl, supabaseKey, options)
60✔
41
}
42

43
// Check for Node.js <= 18 deprecation
44
function shouldShowDeprecationWarning(): boolean {
45
  if (
3!
46
    typeof window !== 'undefined' ||
12✔
47
    typeof process === 'undefined' ||
48
    process.version === undefined ||
49
    process.version === null
50
  ) {
NEW
51
    return false
×
52
  }
53

54
  const versionMatch = process.version.match(/^v(\d+)\./)
3✔
55
  if (!versionMatch) {
3!
NEW
56
    return false
×
57
  }
58

59
  const majorVersion = parseInt(versionMatch[1], 10)
3✔
60
  return majorVersion <= 18
3✔
61
}
62

63
if (shouldShowDeprecationWarning()) {
3!
NEW
64
  console.warn(
×
65
    `⚠️  Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. ` +
66
      `Please upgrade to Node.js 20 or later. ` +
67
      `For more information, visit: https://github.com/orgs/supabase/discussions/37217`
68
  )
69
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc