1
1
<script lang =" ts" >
2
2
import { Alert , Code } from ' $lib/components' ;
3
3
import { WizardStep } from ' $lib/layout' ;
4
- import { isSelfHosted } from ' $lib/system' ;
4
+ import { isCloud } from ' $lib/system' ;
5
5
import { sdk } from ' $lib/stores/sdk' ;
6
6
import Id from ' $lib/components/id.svelte' ;
7
7
8
8
const { endpoint, project } = sdk .forProject .client .config ;
9
9
const code = ` import Appwrite
10
10
11
- let client = Client()
11
+ ${
12
+ isCloud
13
+ ? ` let client = Client().setProject("${project }") `
14
+ : ` let client = Client()
12
15
.setEndpoint("${endpoint }")
13
16
.setProject("${project }")
14
- .setSelfSigned(true) // For self signed certificates, only use for development ` ;
17
+ .setSelfSigned(true) // For self signed certificates, only use for development `
18
+ } ` ;
15
19
16
20
let showAlert = true ;
17
21
</script >
@@ -21,16 +25,16 @@ let client = Client()
21
25
22
26
<h2 class =" heading-level-7" >Initialize your SDK</h2 >
23
27
<p >
24
- Initialize your SDK by pointing the client to your Appwrite project using your < Id
25
- value ={project }>Project ID</Id
26
- > .
28
+ Initialize your SDK by pointing the client to your Appwrite project using your
29
+ < Id value ={project }>Project ID</Id >
30
+ .
27
31
</p >
28
32
<Code label ="Apple SDK" labelIcon ="apple" language ="swift" {code } withCopy withLineNumbers />
29
33
<p class =" u-margin-block-start-24" >
30
34
Before sending any API calls to your new Appwrite project, make sure your device or emulator
31
35
has network access to your Appwrite project's hostname or IP address.
32
36
</p >
33
- {#if showAlert && isSelfHosted }
37
+ {#if showAlert && ! isCloud }
34
38
<div class =" common-section" >
35
39
<Alert type ="info" dismissible on:dismiss ={() => (showAlert = false )}>
36
40
<svelte:fragment slot =" title" >For self-hosted solutions</svelte:fragment >
0 commit comments